mirror of https://github.com/tailscale/tailscale/
cmd/nginx-auth: maintainer scripts and tailnet checking (#4460)
* cmd/nginx-auth: add maintainer scripts Signed-off-by: Xe <xe@tailscale.com> * cmd/nginx-auth: add Expected-Tailnet header and documentation Signed-off-by: Xe <xe@tailscale.com>pull/4461/head
parent
33fa43252e
commit
fc2f628d4c
@ -0,0 +1,14 @@
|
|||||||
|
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
|
||||||
|
deb-systemd-helper unmask 'tailscale.nginx-auth.socket' >/dev/null || true
|
||||||
|
if deb-systemd-helper --quiet was-enabled 'tailscale.nginx-auth.socket'; then
|
||||||
|
deb-systemd-helper enable 'tailscale.nginx-auth.socket' >/dev/null || true
|
||||||
|
else
|
||||||
|
deb-systemd-helper update-state 'tailscale.nginx-auth.socket' >/dev/null || true
|
||||||
|
fi
|
||||||
|
|
||||||
|
if systemctl is-active tailscale.nginx-auth.socket >/dev/null; then
|
||||||
|
systemctl --system daemon-reload >/dev/null || true
|
||||||
|
deb-systemd-invoke stop 'tailscale.nginx-auth.service' >/dev/null || true
|
||||||
|
deb-systemd-invoke restart 'tailscale.nginx-auth.socket' >/dev/null || true
|
||||||
|
fi
|
||||||
|
fi
|
@ -0,0 +1,19 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
set -e
|
||||||
|
if [ -d /run/systemd/system ] ; then
|
||||||
|
systemctl --system daemon-reload >/dev/null || true
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -x "/usr/bin/deb-systemd-helper" ]; then
|
||||||
|
if [ "$1" = "remove" ]; then
|
||||||
|
deb-systemd-helper mask 'tailscale.nginx-auth.socket' >/dev/null || true
|
||||||
|
deb-systemd-helper mask 'tailscale.nginx-auth.service' >/dev/null || true
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$1" = "purge" ]; then
|
||||||
|
deb-systemd-helper purge 'tailscale.nginx-auth.socket' >/dev/null || true
|
||||||
|
deb-systemd-helper unmask 'tailscale.nginx-auth.socket' >/dev/null || true
|
||||||
|
deb-systemd-helper purge 'tailscale.nginx-auth.service' >/dev/null || true
|
||||||
|
deb-systemd-helper unmask 'tailscale.nginx-auth.service' >/dev/null || true
|
||||||
|
fi
|
||||||
|
fi
|
@ -0,0 +1,8 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
set -e
|
||||||
|
if [ "$1" = "remove" ]; then
|
||||||
|
if [ -d /run/systemd/system ]; then
|
||||||
|
deb-systemd-invoke stop 'tailscale.nginx-auth.service' >/dev/null || true
|
||||||
|
deb-systemd-invoke stop 'tailscale.nginx-auth.socket' >/dev/null || true
|
||||||
|
fi
|
||||||
|
fi
|
@ -0,0 +1,9 @@
|
|||||||
|
# $1 == 0 for uninstallation.
|
||||||
|
# $1 == 1 for removing old package during upgrade.
|
||||||
|
|
||||||
|
systemctl daemon-reload >/dev/null 2>&1 || :
|
||||||
|
if [ $1 -ge 1 ] ; then
|
||||||
|
# Package upgrade, not uninstall
|
||||||
|
systemctl stop tailscale.nginx-auth.service >/dev/null 2>&1 || :
|
||||||
|
systemctl try-restart tailscale.nginx-auth.socket >/dev/null 2>&1 || :
|
||||||
|
fi
|
@ -0,0 +1,9 @@
|
|||||||
|
# $1 == 0 for uninstallation.
|
||||||
|
# $1 == 1 for removing old package during upgrade.
|
||||||
|
|
||||||
|
if [ $1 -eq 0 ] ; then
|
||||||
|
# Package removal, not upgrade
|
||||||
|
systemctl --no-reload disable tailscale.nginx-auth.socket > /dev/null 2>&1 || :
|
||||||
|
systemctl stop tailscale.nginx-auth.socket > /dev/null 2>&1 || :
|
||||||
|
systemctl stop tailscale.nginx-auth.service > /dev/null 2>&1 || :
|
||||||
|
fi
|
Loading…
Reference in New Issue