3 [ "${PKG_UPGRADE}" = "1" ] && /etc
/init.d
/etesync-server stop
5 cd /usr
/share
/etesync-server ||
exit 1
7 python3 manage.pyc migrate
--noinput ||
exit 1
9 # setup minimal ini for collectstatic:
10 mkdir
-p /var
/etc
/etesync-server
/ ||
exit 1
11 printf "[global]\nSTATIC_ROOT=/www/etesync/static" >etesync-server.ini ||
exit 1
12 python3 manage.pyc collectstatic
--noinput ||
exit 1
14 ETESYNC_HAS_USER_PY3CMD
="import sqlite3
15 c = sqlite3.connect('db.sqlite3').cursor()
16 c.execute('select * from auth_user')
17 if c.fetchone()==None: print('0')
22 if [ "$(python3 -c "$ETESYNC_HAS_USER_PY3CMD" || exit 1)" = "0" ]
24 echo "===== First, create a superuser of the Webinterface by ====="
25 [ -t 0 ] && python3 manage.pyc createsuperuser ||
26 echo "===== python3 $(pwd)/manage.pyc createsuperuser ====="
29 chown
-Rh etesync
:nogroup .
/www
/etesync
/ ||
exit 1
31 [ -x /etc
/init.d
/nginx
] ||
exit 1
33 /etc
/init.d
/nginx running
&& /etc
/init.d
/nginx reload ||
/etc
/init.d
/nginx start
36 local ifstat
="$(ifstatus "lan
")"
38 for ip
in $
(echo "${ifstat}" | jsonfilter
-e '@["ipv4-address"].*.address')
39 do echo "${ip}" && return
42 for ip
in $
(echo "${ifstat}" | jsonfilter
-e '@["ipv6-address"].*.address')
43 do echo "[${ip}]" && return
46 for ip
in $
(echo "${ifstat}" | \
47 jsonfilter
-e '@["ipv6-prefix-assignment"].*["local-address"].address')
48 do echo "[${ip}]" && return
54 echo "===== You can add users by https://$(router_ip)/etesync/admin/login ====="