-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🔨 Migrate old-style base scripts s6-rc (#163)
- Loading branch information
Showing
11 changed files
with
32 additions
and
11 deletions.
There are no files selected for viewing
Empty file.
1 change: 1 addition & 0 deletions
1
zerotier/rootfs/etc/cont-init.d/zerotier.sh → .../etc/s6-overlay/s6-rc.d/init-zerotier/run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
oneshot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/etc/s6-overlay/s6-rc.d/init-zerotier/run |
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/command/with-contenv bashio | ||
# shellcheck shell=bash | ||
# ============================================================================== | ||
# Home Assistant Community Add-on: ZeroTier One | ||
# Take down the S6 supervision tree when ZeroTier fails | ||
# ============================================================================== | ||
declare exit_code | ||
readonly exit_code_container=$(</run/s6-linux-init-container-results/exitcode) | ||
readonly exit_code_service="${1}" | ||
readonly exit_code_signal="${2}" | ||
readonly service="ZeroTier One" | ||
|
||
bashio::log.info \ | ||
"Service ${service} exited with code ${exit_code_service}" \ | ||
"(by signal ${exit_code_signal})" | ||
|
||
if [[ "${exit_code_service}" -eq 256 ]]; then | ||
if [[ "${exit_code_container}" -eq 0 ]]; then | ||
echo $((128 + $exit_code_signal)) > /run/s6-linux-init-container-results/exitcode | ||
fi | ||
[[ "${exit_code_signal}" -eq 15 ]] && exec /run/s6/basedir/bin/halt | ||
elif [[ "${exit_code_service}" -ne 0 ]]; then | ||
if [[ "${exit_code_container}" -eq 0 ]]; then | ||
echo "${exit_code_service}" > /run/s6-linux-init-container-results/exitcode | ||
fi | ||
exec /run/s6/basedir/bin/halt | ||
fi |
1 change: 1 addition & 0 deletions
1
zerotier/rootfs/etc/services.d/zerotier/run → ...ootfs/etc/s6-overlay/s6-rc.d/zerotier/run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
longrun |
This file was deleted.
Oops, something went wrong.