File tree Expand file tree Collapse file tree
etc/s6-overlay/s6-rc.d/post-tailscaled Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ export LOG_FD
66# Runs after the machine has been logged in into the Tailscale network
77# ==============================================================================
88
9- source /usr/lib/core.sh
9+ source /usr/lib/api. core.sh
1010
1111declare interface
1212declare -a options
@@ -174,7 +174,7 @@ if keyexpiry=$(/opt/tailscale status --self=true --peers=false --json | jq -rce
174174 "Consider disabling key expiry to avoid losing connection to your Home Assistant device." \
175175 "You can use the [Machines page](https://login.tailscale.com/admin/machines) of Tailscale's admin console to disable key expiry." \
176176 "Please check your configuration based on the app's documentation under the \"Configuration\" section.")")
177- if core. api POST services/persistent_notification/create "${attributes}" -w > /dev/null; then
177+ if api.core POST services/persistent_notification/create "${attributes}" -w > /dev/null; then
178178 touch "/data/key_expiry_notification_is_done"
179179 fi
180180 fi
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ function log.error_or_warning() {
2323# -s "Silent" Supress error message in case of a 404 Not found HTTP status code
2424# -w "Warning only" Log only warnings instead of errors
2525# ------------------------------------------------------------------------------
26- function core. api() {
26+ function api.core () {
2727 local method=" ${1} " ; shift
2828 local resource=" /core/api/${1} " ; shift
2929 local data=' {}'
@@ -116,7 +116,8 @@ function core.api() {
116116
117117 if bashio::var.has_value " ${filter} " ; then
118118 bashio::log.debug " Filtering response using: ${filter} "
119- response=$( bashio::jq " ${response} " " ${filter} " )
119+ response=$( bashio::jq " ${response} " " ${filter} " ) \
120+ || return " ${__BASHIO_EXIT_NOK} "
120121 fi
121122
122123 echo " ${response} "
You can’t perform that action at this time.
0 commit comments