Remove legacy systemd services from uninstall()

This commit is contained in:
2024-12-06 13:39:48 -05:00
parent 2883aed0ac
commit d9e02e430d

View File

@@ -1498,13 +1498,13 @@ disable_btrfs_cow() {
# @description Completely uninstalls MC, services, and firewall rules # @description Completely uninstalls MC, services, and firewall rules
uninstall() { uninstall() {
debug "Running: ${FUNCNAME[0]}" debug "Running: ${FUNCNAME[0]}"
local service unit f i local service type unit f
echo "Stopping and removing all Media Center services" echo "Stopping and removing all Media Center services"
for service in $(compgen -A "function" "service"); do for service in $(compgen -A "function" "service"); do
service="${service##service_}" service="${service##service_}"
for i in user system; do for type in user system; do
set_service_vars "$service" "$i"; set_service_vars "$service" "$type";
for unit in "$SERVICE_NAME" "$TIMER_NAME"; do for unit in "$SERVICE_NAME" "$TIMER_NAME"; do
if "${IS_ACTIVE[@]}" "$unit" || if "${IS_ACTIVE[@]}" "$unit" ||
"${IS_ENABLED[@]}" "$unit"; then "${IS_ENABLED[@]}" "$unit"; then
@@ -1512,16 +1512,10 @@ uninstall() {
fi fi
done done
for f in "$SERVICE_FNAME" "$TIMER_FNAME"; do for f in "$SERVICE_FNAME" "$TIMER_FNAME"; do
[[ -f $f ]] && [[ -f $f ]] && execute sudo rm -f "$f"
execute sudo rm -f "$f"
done done
"${RELOAD[@]}" "${RELOAD[@]}"
unset f
done done
for f in /etc/systemd/system/jriver-*; do
execute sudo rm -f "$f"
done
unset f
done done
echo "Removing MC repositories" echo "Removing MC repositories"