debian/init.d: add migration support

This commit is contained in:
Jérôme Schneider 2014-02-17 19:19:03 +01:00
parent 8e6affddd9
commit c949bc10b8
1 changed files with 8 additions and 0 deletions

8
debian/init.d vendored
View File

@ -111,8 +111,15 @@ do_reload() {
return 0
}
do_migrate() {
log_action_msg "Applying new migrations .."
su $USER -p -c "/usr/bin/compte-agglo-montpellier syncdb --migrate --noinput"
log_action_msg ".. done"
}
case "$1" in
start)
do_migrate
log_daemon_msg "Starting $DESC " "$NAME"
do_start
case "$?" in
@ -147,6 +154,7 @@ case "$1" in
#
log_daemon_msg "Restarting $DESC" "$NAME"
do_stop
do_migrate
case "$?" in
0|1)
do_start