Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
executable file 48 lines (41 sloc) 1.31 KB
#!/bin/sh
### BEGIN INIT INFO
# Provides: weblate
# Required-Start: $local_fs $remote_fs $network
# Should-Start: $named $time postgresql sendmail mysql ypclient dhcp radiusd
# Should-Stop: $named $time postgresql sendmail mysql ypclient dhcp radiusd
# Required-Stop: $local_fs $remote_fs $network
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Short-Description: Weblate
# Description: Setup Weblate
### END INIT INFO
. /etc/rc.status
. /etc/sysconfig/cron
rc_reset
case "$1" in
start)
if [ ! -f /var/lib/weblate/setup ] ; then
echo 'Creating database for Weblate'
su - wwwrun -s /bin/bash -c '/usr/share/weblate/manage.py syncdb --noinput'
rc_status -v -r
echo 'Adding admin user for Weblate'
su - wwwrun -s /bin/bash -c '/usr/share/weblate/manage.py createadmin'
rc_status -v -r
touch /var/lib/weblate/setup
fi
;;
stop|restart)
# skip / nothing to do
;;
status)
# assume we have been run
rc_reset
rc_status -v
;;
*)
echo "Usage: $0 {start|stop|status|restart}"
exit 1
;;
esac
rc_exit
Something went wrong with that request. Please try again.