Skip to content

Commit

Permalink
Remove duplicate status checks from dependent S6 services (#196)
Browse files Browse the repository at this point in the history
  • Loading branch information
lmagyar authored Oct 15, 2023
1 parent 92122ba commit 5e26744
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 17 deletions.
15 changes: 14 additions & 1 deletion tailscale/rootfs/etc/s6-overlay/s6-rc.d/post-tailscaled/run
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,17 @@ do
sleep 2
done

/opt/tailscale up "${options[@]}"
# Start Tailscale
if ! /opt/tailscale up "${options[@]}"; then
bashio::log.error "Unable to start up Tailscale"
bashio::exit.nok
fi

# Wait for the network to be available and logged in
while ! /opt/tailscale status --json --peers=false --self=false \
| jq --exit-status '.BackendState == "Running"' > /dev/null
do
sleep 2
done

bashio::log.info "Tailscale is running"
8 changes: 0 additions & 8 deletions tailscale/rootfs/etc/s6-overlay/s6-rc.d/proxy/run
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,6 @@

declare domain

# Wait for the network to be available and logged in
while ! bashio::fs.socket_exists "/var/run/tailscale/tailscaled.sock" || \
! /opt/tailscale status --json --peers=false --self=false \
| jq --exit-status '.BackendState == "Running"' > /dev/null
do
sleep 2
done

# Check if Tailscale HTTPS is enabled
if ! /opt/tailscale status --self=true --peers=false --json \
| jq -rce ".CertDomains[0]" > /dev/null;
Expand Down
8 changes: 0 additions & 8 deletions tailscale/rootfs/etc/s6-overlay/s6-rc.d/taildrop/run
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,6 @@
# Fetches files send via Taildrop
# ==============================================================================

# Wait for the network to be available and logged in
while ! bashio::fs.socket_exists "/var/run/tailscale/tailscaled.sock" || \
! /opt/tailscale status --json --peers=false --self=false \
| jq --exit-status '.BackendState == "Running"' > /dev/null
do
sleep 2
done

# Ensure the directory exists
mkdir -p /share/taildrop

Expand Down

0 comments on commit 5e26744

Please sign in to comment.