]> git.madduck.net Git - code/molly-guard.git/blobdiff - shutdown.in

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

factor out destination directories to Makefile
[code/molly-guard.git] / shutdown.in
similarity index 90%
rename from shutdown
rename to shutdown.in
index 3ffacc9fe126bffb747cb39e4458062ea39d232d..32ba58d8fc299c970889cddc2c7bcacbb1dc680e 100755 (executable)
--- a/shutdown
@@ -9,7 +9,8 @@ set -eu
 
 ME=molly-guard
 VERSION=0.4
-SCRIPTSDIR=/etc/molly-guard/run.d
+
+SCRIPTSDIR="@ETC_PREFIX@/etc/$ME/run.d"
 
 CMD="${0##*/}"
 EXEC="/sbin/$CMD"
@@ -17,16 +18,16 @@ EXEC="/sbin/$CMD"
 case "$CMD" in
   halt|reboot|shutdown|poweroff)
     if [ ! -f $EXEC ]; then
-      echo "E: $ME: not a regular file: $EXEC" >&2
+      echo "E: not a regular file: $EXEC" >&2
       exit 4
     fi
     if [ ! -x $EXEC ]; then
-      echo "E: $ME: not an executable: $EXEC" >&2
+      echo "E: not an executable: $EXEC" >&2
       exit 3
     fi
     ;;
   *)
-    echo "E: $ME: unsupported command: $CMD" >&2
+    echo "E: unsupported command: $CMD" >&2
     exit 1
     ;;
 esac
@@ -103,7 +104,7 @@ esac
 
 MOLLYGUARD_CMD=$CMD; export MOLLYGUARD_CMD
 MOLLYGUARD_DO_NOTHING=$DO_NOTHING; export MOLLYGUARD_DO_NOTHING
-MOLLYGUARD_SETTINGS="/etc/molly-guard/rc"; export MOLLYGUARD_SETTINGS
+MOLLYGUARD_SETTINGS="@ETC_PREFIX@/etc/$ME/rc"; export MOLLYGUARD_SETTINGS
 
 for script in $(run-parts --test $SCRIPTSDIR); do
   ret=0