virtual-appliance/appliances/airport/start-airport
Albert Hopkins f79cc8a353 Move appliances/configs/scripts to seperate directories.
Instead of having everything in the root directory, split them in seperate
directories (appliances, scripts, & configs).  This makes things a little
tidier.

Also added a now Makefile target, appliance-list, that prints a list of the
available appliances.  The split directory change made this easier.
2014-06-09 02:26:17 +00:00

30 lines
766 B
Bash
Executable File

#!/bin/sh
# this should be run as the airport user
PYTHON=python
PYTHONPATH=/var/airport ; export PYTHONPATH
DJANGO_SETTINGS_MODULE="etc.settings" ; export DJANGO_SETTINGS_MODULE
cd ~
. bin/activate
cd djangoproject
if [ ! -f "/etc/firstboot" ] ; then
$PYTHON manage.py syncdb --noinput --verbosity=0
$PYTHON manage.py collectstatic --noinput --verbosity=0
fi
# start the uwsgi daemon
uwsgi --socket /var/airport/airport.sock \
--chmod=660 \
-w djangoproject.wsgi \
--uid airport \
--gid airport \
--pidfile /var/airport/uwsgi.pid \
--daemonize2 /var/airport/airport.log \
-T
# Start the Game Server
$PYTHON manage.py gameserver --verbosity=2 $@ > "/var/airport/gameserver.log" 2>&1 &
echo $! > "/var/airport/gameserver.pid"