mirror of https://github.com/lukechilds/umbrel.git
Luke Childs
5 years ago
4 changed files with 27 additions and 0 deletions
@ -0,0 +1,19 @@ |
|||
#!/usr/bin/env bash |
|||
|
|||
root_dir="$(readlink -f $1)" |
|||
signal_dir="$root_dir/signals" |
|||
trigger_dir="$root_dir/triggers" |
|||
|
|||
fswatch -0 --event=PlatformSpecific $signal_dir | while read -d "" event; do |
|||
signal="${event#"$signal_dir"}" |
|||
signal="${signal#"/"}" |
|||
trigger="$trigger_dir/$signal" |
|||
|
|||
echo "Got signal: $signal" |
|||
if test -x "$trigger"; then |
|||
echo "Executing trigger" |
|||
"$trigger" |
|||
else |
|||
echo "No trigger found" |
|||
fi |
|||
done |
@ -0,0 +1,4 @@ |
|||
#!/usr/bin/env bash |
|||
set -euo pipefail |
|||
|
|||
shutdown -r now |
@ -0,0 +1,4 @@ |
|||
#!/usr/bin/env bash |
|||
set -euo pipefail |
|||
|
|||
shutdown -h now |
Loading…
Reference in new issue