Add 24 files
All checks were successful
Test and Publish Templates / test-and-publish (push) Successful in 14s
All checks were successful
Test and Publish Templates / test-and-publish (push) Successful in 14s
This commit is contained in:
26
tailscale-relay/status.sh
Executable file
26
tailscale-relay/status.sh
Executable file
@@ -0,0 +1,26 @@
|
||||
#!/bin/bash
|
||||
# shellcheck disable=SC1091
|
||||
source "${AGENT_PATH}/common.sh"
|
||||
_check_required_env_vars "CONTAINER_NAME"
|
||||
|
||||
if ! command -v lxc &>/dev/null; then
|
||||
echo "Unknown"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if ! lxc info "${CONTAINER_NAME}" &>/dev/null; then
|
||||
echo "Unknown"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if ! lxc info "${CONTAINER_NAME}" 2>/dev/null | grep -q "Status: RUNNING"; then
|
||||
echo "Stopped"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Container is running - check if tailscale is connected
|
||||
if lxc exec "${CONTAINER_NAME}" -- tailscale status &>/dev/null; then
|
||||
echo "Running"
|
||||
else
|
||||
echo "Error"
|
||||
fi
|
||||
Reference in New Issue
Block a user