]> git.pld-linux.org Git - packages/rpm-pld-macros.git/blobdiff - service_generator.sh
adjust to build with git
[packages/rpm-pld-macros.git] / service_generator.sh
old mode 100644 (file)
new mode 100755 (executable)
index 2519854..39551a8
@@ -19,7 +19,8 @@ fi
 # common part
 service_body() {
        cat <<-EOF
-               if [ -f /var/lock/subsys/$service ]; then
+               if [ ! -x /bin/systemd_booted ] || ! /bin/systemd_booted; then
+                       if [ -f /var/lock/subsys/$service ]; then
        EOF
        if [ "$noop" = 1 ]; then
                echo :
@@ -31,11 +32,12 @@ service_body() {
 
        if [ "$quiet" != 1 ]; then
                cat <<-EOF
-               else
-                       echo 'Run "/sbin/service $service start" to start $desc.'
+                       else
+                               echo 'Run "/sbin/service $service start" to start $desc.'
                EOF
        fi
        cat <<-EOF
+                       fi
                fi
        EOF
 }
@@ -56,6 +58,15 @@ if [ "$check" = 1 ]; then
        skip_auto_restart_body
        echo 'if [ $(skip_auto_restart) = no ]; then'
                service_body
+       echo 'else'
+               # service restart was disabled, tell them to restart it
+       cat <<-EOF
+               if [ ! -x /bin/systemd_booted ] || ! /bin/systemd_booted; then
+                       if [ -f /var/lock/subsys/$service ]; then
+                               echo 'Run "/sbin/service $service restart" to restart $desc.'
+                       fi
+               fi
+       EOF
        echo 'fi'
 else
        service_body
This page took 0.177521 seconds and 4 git commands to generate.