Fix the invirt-dev init script, because bash doesn't believe in
[invirt/packages/invirt-dev.git] / debian / invirt-dev.init
index 160aabd..a5bc89a 100755 (executable)
 NAME=invirt-dev
 GEN_FILES=/srv/repository/conf/distributions
 
+. /lib/init/std-init.sh
 . /lib/init/gen-files.sh
 
-case "$1" in
-  start|reload|force-reload|restart)
-    log_begin_msg "Reloading config for $PACKAGE"
-    gen_files
-    reprepro-env export
-    invirt-build-conf
-    log_end_msg $?
-    ;;
-  stop)
-    ;;
-  *)
-    log_success_msg "Usage: /etc/init.d/$NAME {start|reload|force-reload|restart|stop}"
-    ;;
-esac
+do_start()
+{
+    # Return
+    #  0 if daemon has been started
+    #  1 if daemon was already running
+    #  2 if daemon could not be started
+    ret=0
+    gen_files || ret=2
+    reprepro-env export || ret=2
+    invirt-build-conf || ret=2
+
+    return $ret
+}
+
+do_stop()
+{
+    :
+}
+
+do_reload()
+{
+    do_start
+}