mirror of
https://github.com/tailscale-dev/deck-tailscale.git
synced 2025-10-21 23:18:12 +00:00
use provided files, override
This commit is contained in:
19
tailscale.sh
19
tailscale.sh
@@ -53,10 +53,23 @@ mkdir -p /var/lib/extensions
|
||||
rm -rf /var/lib/extensions/tailscale
|
||||
cp -rf tailscale /var/lib/extensions/
|
||||
|
||||
# copy the systemd files into place
|
||||
cp -rf $tar_dir/systemd/tailscaled.service /etc/systemd/system
|
||||
|
||||
# copy in the defaults file if it doesn't already exist
|
||||
if ! test -f /etc/default/tailscaled; then
|
||||
cp -rf $tar_dir/systemd/tailscaled.defaults /etc/default/tailscaled
|
||||
fi
|
||||
|
||||
# return to our original directory (silently) and clean up
|
||||
popd > /dev/null
|
||||
rm -rf "${dir}"
|
||||
|
||||
# copy in our overrides file if it doesn't already exist
|
||||
if ! test -f /etc/systemd/system/tailscaled.service.d/override.conf; then
|
||||
cp -rf override.conf /etc/systemd/system/tailscaled.service.d/override.conf
|
||||
fi
|
||||
|
||||
echo "done."
|
||||
|
||||
echo -n "Starting services..."
|
||||
@@ -71,12 +84,10 @@ systemd-sysext refresh > /dev/null 2>&1
|
||||
systemctl daemon-reload > /dev/null
|
||||
|
||||
if systemctl is-enabled --quiet tailscaled && systemctl is-active --quiet tailscaled; then
|
||||
echo "tailscaled is already enabled and active"
|
||||
echo "tailscaled is already enabled and active; restarting it..."
|
||||
systemctl restart tailscaled
|
||||
else
|
||||
systemctl enable tailscaled --now
|
||||
fi
|
||||
|
||||
echo "done."
|
||||
|
||||
|
||||
echo "If updating, reboot or run the following to finish the process: sudo systemctl restart tailscaled"
|
||||
|
Reference in New Issue
Block a user