Commit 17db5943 authored by Michal Čihař's avatar Michal Čihař

Init script to setup weblate

parent 07572a0a
#!/bin/sh
### BEGIN INIT INFO
# Provides: apache apache2 httpd
# 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 databse 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 loaddata /usr/share/weblate/initial_data.json'
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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment