Skip to content

Commit 429c1f8

Browse files
committed
fix: Ensure we handle broken links appropriately
1 parent 29d1a0f commit 429c1f8

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

package/unios_2.x.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,15 +83,23 @@ _tailscale_install() {
8383
exit 1
8484
}
8585

86-
if [ ! -e "/etc/systemd/system/tailscale-install.service" ]; then
86+
if [ ! -L "/etc/systemd/system/tailscale-install.service" ]; then
87+
if [ ! -e "${TAILSCALE_ROOT}/tailscale-install.service" ]; then
88+
rm -f /etc/systemd/system/tailscale-install.service
89+
fi
90+
8791
echo "Installing pre-start script to install Tailscale on firmware updates."
8892
ln -s "${TAILSCALE_ROOT}/tailscale-install.service" /etc/systemd/system/tailscale-install.service
8993

9094
systemctl daemon-reload
9195
systemctl enable tailscale-install.service
9296
fi
9397

94-
if [ ! -e "/etc/systemd/system/tailscale-install.timer" ]; then
98+
if [ ! -L "/etc/systemd/system/tailscale-install.timer" ]; then
99+
if [ ! -e "${TAILSCALE_ROOT}/tailscale-install.timer" ]; then
100+
rm -f /etc/systemd/system/tailscale-install.timer
101+
fi
102+
95103
echo "Installing auto-update timer to ensure that Tailscale is kept installed and up to date."
96104
ln -s "${TAILSCALE_ROOT}/tailscale-install.timer" /etc/systemd/system/tailscale-install.timer
97105

0 commit comments

Comments
 (0)