pinwheel: Update work-vpn script

This commit is contained in:
Alexander Heldt
2025-12-27 11:00:01 +01:00
parent 4d0e3681cb
commit 6f6090e046
2 changed files with 29 additions and 4 deletions

View File

@@ -85,11 +85,25 @@ let
'';
work-vpn-status = pkgs.writeShellScript "work-vpn-status" ''
STAGING=$(systemctl is-active openvpn-work-staging.service)
[ "$STAGING" == "active" ] && echo "WORK-VPN STAGING ON" && exit 0
ACTIVE_ENVS=""
PRODUCTION=$(systemctl is-active openvpn-work-production.service)
[ "$PRODUCTION" == "active" ] && echo "WORK-VPN PRODUCTION ON" && exit 0
STAGING_STATUS=$(systemctl is-active openvpn-work-staging.service)
if [ "$STAGING_STATUS" == "active" ]; then
ACTIVE_ENVS="S"
fi
PRODUCTION_STATUS=$(systemctl is-active openvpn-work-production.service)
if [ "$PRODUCTION_STATUS" == "active" ]; then
if [ -n "$ACTIVE_ENVS" ]; then
ACTIVE_ENVS="$ACTIVE_ENVS&P"
else
ACTIVE_ENVS="P"
fi
fi
if [ -n "$ACTIVE_ENVS" ]; then
echo "WORK-VPN $ACTIVE_ENVS ON"
fi
'';
toggle-bt-power = pkgs.writeShellScript "toggle-bt-power" ''