server: update to v2.3 — dual-protocol relay (v1 pair + v2 lobby) + auto-updater with EXIT trap fix
This commit is contained in:
+39
-16
@@ -1,12 +1,14 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# uninstall.sh — Remove the RemSound UDP relay cleanly.
|
# uninstall.sh — Remove the RemSound UDP relay and its auto-updater cleanly.
|
||||||
#
|
#
|
||||||
# Run with sudo:
|
# Run with sudo:
|
||||||
# sudo ./uninstall.sh
|
# sudo ./uninstall.sh
|
||||||
#
|
#
|
||||||
# Stops the service, disables it, removes the script and unit file, and
|
# Stops and disables both the relay and the updater timer, removes their
|
||||||
# leaves the log file in place (rename or delete it yourself if you don't
|
# scripts and unit files, and removes the /etc/remsound-relay/ state dir
|
||||||
# want it kept). Does NOT touch your router port-forward — that's separate.
|
# (version file + rollback backups). Leaves log files in place — rename or
|
||||||
|
# delete them yourself if you don't want them kept. Does NOT touch your
|
||||||
|
# router port-forward — that's separate.
|
||||||
|
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
@@ -15,26 +17,47 @@ if [[ $EUID -ne 0 ]]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Stop the updater timer first so it can't fire mid-uninstall.
|
||||||
|
if systemctl list-unit-files remsound-relay-update.timer >/dev/null 2>&1; then
|
||||||
|
echo "Stopping remsound-relay-update.timer ..."
|
||||||
|
systemctl stop remsound-relay-update.timer 2>/dev/null || true
|
||||||
|
systemctl disable remsound-relay-update.timer 2>/dev/null || true
|
||||||
|
fi
|
||||||
|
|
||||||
|
if systemctl list-unit-files remsound-relay-update.service >/dev/null 2>&1; then
|
||||||
|
systemctl stop remsound-relay-update.service 2>/dev/null || true
|
||||||
|
fi
|
||||||
|
|
||||||
if systemctl list-unit-files remsound-relay.service >/dev/null 2>&1; then
|
if systemctl list-unit-files remsound-relay.service >/dev/null 2>&1; then
|
||||||
echo "Stopping remsound-relay ..."
|
echo "Stopping remsound-relay.service ..."
|
||||||
systemctl stop remsound-relay.service || true
|
systemctl stop remsound-relay.service 2>/dev/null || true
|
||||||
echo "Disabling remsound-relay ..."
|
echo "Disabling remsound-relay.service ..."
|
||||||
systemctl disable remsound-relay.service >/dev/null 2>&1 || true
|
systemctl disable remsound-relay.service 2>/dev/null || true
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -f /etc/systemd/system/remsound-relay.service ]]; then
|
for f in \
|
||||||
echo "Removing /etc/systemd/system/remsound-relay.service ..."
|
/etc/systemd/system/remsound-relay.service \
|
||||||
rm -f /etc/systemd/system/remsound-relay.service
|
/etc/systemd/system/remsound-relay-update.service \
|
||||||
fi
|
/etc/systemd/system/remsound-relay-update.timer \
|
||||||
|
/usr/local/sbin/remsound-relay.py \
|
||||||
|
/usr/local/sbin/remsound-relay-update.sh
|
||||||
|
do
|
||||||
|
if [[ -f "$f" ]]; then
|
||||||
|
echo "Removing $f ..."
|
||||||
|
rm -f "$f"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
if [[ -f /usr/local/sbin/remsound-relay.py ]]; then
|
if [[ -d /etc/remsound-relay ]]; then
|
||||||
echo "Removing /usr/local/sbin/remsound-relay.py ..."
|
echo "Removing /etc/remsound-relay/ (version stamp + backup) ..."
|
||||||
rm -f /usr/local/sbin/remsound-relay.py
|
rm -rf /etc/remsound-relay
|
||||||
fi
|
fi
|
||||||
|
|
||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo "Uninstall complete."
|
echo "Uninstall complete."
|
||||||
echo "Note: /var/log/remsound-relay.log is left in place — delete it yourself if you don't want it."
|
echo "Note: log files left in place — delete them yourself if you don't want them:"
|
||||||
|
echo " /var/log/remsound-relay.log"
|
||||||
|
echo " /var/log/remsound-relay-update.log"
|
||||||
echo "Note: any router port-forward you added for UDP 47830 is unchanged — remove that yourself if you no longer need it."
|
echo "Note: any router port-forward you added for UDP 47830 is unchanged — remove that yourself if you no longer need it."
|
||||||
|
|||||||
Reference in New Issue
Block a user