]> code.delx.au - monosys/commitdiff
reboot-no-passphrase: support custom reboot command
authorJames Bunton <jamesbunton@delx.net.au>
Fri, 30 Jun 2017 09:06:28 +0000 (19:06 +1000)
committerJames Bunton <jamesbunton@delx.net.au>
Fri, 30 Jun 2017 09:06:28 +0000 (19:06 +1000)
reboot-no-passphrase

index fe4af4444a52ae9047effef6aa8359c64ec0904d..12713b5a89fe9c66c31f576b4b762f4cb7a81708 100755 (executable)
@@ -10,6 +10,7 @@
 
 
 crypto_keyfile="/crypto_keyfile.bin"
+reboot_cmd="${1:-sudo reboot}"
 
 if [ ! -f "$crypto_keyfile" ]; then
     echo "Failed to find $crypto_keyfile"
@@ -25,4 +26,4 @@ fi
 
 set -ex
 sudo cryptsetup luksAddKey "$device_filename" "$crypto_keyfile" --key-slot 7
-sudo reboot
+$reboot_cmd