Compare commits
No commits in common. "d82cd9b6a7ffe40b9934c5031b0caae841afd7ca" and "9c4728b9976feb4af0d9ee8aea9865da48265bc4" have entirely different histories.
d82cd9b6a7
...
9c4728b997
4 changed files with 13 additions and 37 deletions
27
ctl
27
ctl
|
|
@ -1,17 +1,13 @@
|
|||
#!/bin/sh
|
||||
SERVICES="pandora pandora-tasks pandora-encoding pandora-cron pandora-websocketd"
|
||||
if [ -z "$1" ]; then
|
||||
echo "Usage: $0 (start|stop|restart|reload|status)"
|
||||
echo "Usage: $0 (start|stop|restart|reload)"
|
||||
exit 1
|
||||
else
|
||||
action="$1"
|
||||
fi
|
||||
self=`readlink "$0"`
|
||||
if [ -z $self ]; then
|
||||
self="$0"
|
||||
fi
|
||||
if [ "$action" = "init" ]; then
|
||||
cd "`dirname "$self"`"
|
||||
cd "`dirname "$0"`"
|
||||
BASE=`pwd`
|
||||
SUDO=""
|
||||
PANDORA_USER=`ls -l update.py | cut -f3 -d" "`
|
||||
|
|
@ -47,18 +43,6 @@ if [ "$action" = "init" ]; then
|
|||
fi
|
||||
exit 0
|
||||
fi
|
||||
if [ "$action" = "manage" ]; then
|
||||
cd "`dirname "$self"`"
|
||||
if [ `whoami` != 'root' ]; then
|
||||
manage="./pandora/manage.py"
|
||||
else
|
||||
manage="sudo -u pandora ./pandora/manage.py"
|
||||
fi
|
||||
shift
|
||||
$manage $@
|
||||
exit $?
|
||||
|
||||
fi
|
||||
if [ `whoami` != 'root' ]; then
|
||||
echo you have to be root or run $0 with sudo
|
||||
exit 1
|
||||
|
|
@ -90,13 +74,6 @@ if [ "$action" = "install" ]; then
|
|||
fi
|
||||
exit 0
|
||||
fi
|
||||
if [ "status" = "$action" ]; then
|
||||
export SYSTEMD_PAGER=
|
||||
fi
|
||||
for service in $SERVICES; do
|
||||
if [ -x /bin/systemctl ]; then
|
||||
/bin/systemctl $action $service
|
||||
else
|
||||
service $service $action
|
||||
fi
|
||||
done
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
from django.contrib.gis.geoip2 import GeoIP, GeoIP2Exception2
|
||||
from django.contrib.gis.geoip2 import GeoIP2
|
||||
|
||||
import ox
|
||||
|
||||
|
|
@ -22,7 +22,7 @@ def get_location(ip):
|
|||
else:
|
||||
try:
|
||||
location = g.city(ip)
|
||||
except GeoIP2Exception:
|
||||
except django.contrib.gis.geoip2.GeoIP2Exception:
|
||||
try:
|
||||
location = g.country(s.ip)
|
||||
except:
|
||||
|
|
|
|||
|
|
@ -297,7 +297,7 @@ if __name__ == "__main__":
|
|||
]:
|
||||
run_sql(sql)
|
||||
run(join(base, 'pandora/manage.py'), 'migrate', 'system')
|
||||
run(join(base, 'pandora/manage.py'), 'update_geoip')
|
||||
|
||||
else:
|
||||
if len(sys.argv) == 1:
|
||||
branch = get_branch()
|
||||
|
|
@ -316,13 +316,13 @@ if __name__ == "__main__":
|
|||
if exists(path):
|
||||
os.chdir(path)
|
||||
current_branch = get_branch(path)
|
||||
if repo == 'pandora':
|
||||
pandora_old_revno = revno
|
||||
if current_branch != branch:
|
||||
run('git', 'remote', 'set-branches', 'origin', '*')
|
||||
run('git', 'fetch', 'origin')
|
||||
run('git', 'checkout', branch)
|
||||
revno = get_version(path)
|
||||
if repo == 'pandora':
|
||||
pandora_old_revno = revno
|
||||
current += revno
|
||||
url = repos[repo]['url']
|
||||
print('Checking', repo)
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ NGINX=${NGINX-local}
|
|||
BRANCH=${BRANCH-stable}
|
||||
|
||||
# add a pandora user
|
||||
echo Installing pandora with user: $PANDORA branch: $BRANCH
|
||||
echo Installing pandora with user: $PANDORA
|
||||
getent passwd $PANDORA > /dev/null 2>&1 || adduser --disabled-password --gecos "" $PANDORA
|
||||
|
||||
#
|
||||
|
|
@ -197,9 +197,8 @@ fi
|
|||
if [ "$NGINX" == "local" ]; then
|
||||
|
||||
cp "/srv/pandora/etc/nginx/pandora" "/etc/nginx/sites-available/pandora"
|
||||
rm -f /etc/nginx/sites-enabled/default /etc/nginx/sites-enabled/pandora
|
||||
rm -f /etc/nginx/sites-enabled/default
|
||||
ln -s ../sites-available/pandora /etc/nginx/sites-enabled/pandora
|
||||
ln -s /srv/pandora/ctl /usr/local/bin/pandoractl
|
||||
|
||||
read -r -d '' GZIP <<EOI
|
||||
gzip_static on;\\
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue