about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2017-07-24 17:17:24 +0200
committerLeah Neukirchen <leah@vuxu.org>2017-07-24 17:17:24 +0200
commitdc09edd6e019b971663a07c76e5d66dbd2d69c5c (patch)
tree743afec00c952d08b969aa81ea15d0e30f1e4b98
parentfd2a983c3e466a408d68169812fe388f8a3927ce (diff)
downloadrunit-void-dc09edd6e019b971663a07c76e5d66dbd2d69c5c.tar.gz
runit-void-dc09edd6e019b971663a07c76e5d66dbd2d69c5c.tar.xz
runit-void-dc09edd6e019b971663a07c76e5d66dbd2d69c5c.zip
shutdown: delete empty /etc/nologin on -c.
Fixes #73.
-rwxr-xr-xshutdown3
1 files changed, 3 insertions, 0 deletions
diff --git a/shutdown b/shutdown
index b456647..9d51d54 100755
--- a/shutdown
+++ b/shutdown
@@ -38,6 +38,9 @@ message="${*:-system is going down}"
 
 if [ "$action" = "cancel" ]; then
   kill $(cat /run/runit/shutdown.pid)
+  if [ -e /etc/nologin ] && ! [ -s /etc/nologin ]; then
+    rm /etc/nologin
+  fi
   echo "${*:-shutdown cancelled}" | wall
   exit
 fi