mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
* Address "SyntaxWarning: invalid escape sequence" * Correcttypo for CEC Blue button * Fix enablement when already open * Icons path corrected * Correct path and simplify command * Have enum class generalised * Address compile warnings * Update tinkerforce led_strip * Address compiler waring * Fix Install/Uninstall desktop- and icon file handling * Address "fatal: detected dubious ownership in repository" * platform fix * Test "fatal: detected dubious ownership in repository" * Update "fatal: detected dubious ownership in repository" * Update to Protobuf 25.1 * Update cmds with sudo * Update SEDU default baud rates * Replace deprecated Py_NoSiteFlag * Correct default config --------- Co-authored-by: Paulchen-Panther <16664240+Paulchen-Panther@users.noreply.github.com>
77 lines
2.4 KiB
Bash
77 lines
2.4 KiB
Bash
#!/bin/sh
|
|
|
|
echo "---Hyperion ambient light prerm ---"
|
|
|
|
UPGRADE="$1"
|
|
if [ "$2" = "in-favour" ]; then
|
|
# Treat conflict remove as an upgrade.
|
|
UPGRADE="upgrade"
|
|
fi
|
|
|
|
# Don't clean-up just for an upgrade.`
|
|
if [ "$UPGRADE" = "upgrade" ] ; then
|
|
exit 0
|
|
fi
|
|
|
|
# search for users in system, returns first entry
|
|
FOUND_USR=`who | grep -o -m1 '^\w*\b'` || "root"
|
|
|
|
# stop running daemon before we delete it
|
|
HYPERION_RUNNING=false
|
|
pgrep hyperiond > /dev/null 2>&1 && HYPERION_RUNNING=true
|
|
|
|
if grep -m1 systemd /proc/1/comm > /dev/null
|
|
then
|
|
# systemd
|
|
echo "---> stop init deamon: systemd"
|
|
CURRENT_SERVICE=$(systemctl list-units --all | { grep -o "hyperion*.*\.service" || true; })
|
|
if [ ! -z ${CURRENT_SERVICE} ]; then
|
|
$HYPERION_RUNNING && systemctl stop "${CURRENT_SERVICE}" 2> /dev/null
|
|
systemctl -q disable "${CURRENT_SERVICE}" 2> /dev/null
|
|
else
|
|
$HYPERION_RUNNING && systemctl stop hyperion hyperiond"@${FOUND_USR}" hyperion"@${FOUND_USR}" "hyperiond@root" "hyperion@root" 2> /dev/null
|
|
systemctl -q disable hyperion hyperiond"@${FOUND_USR}" hyperion"@${FOUND_USR}" "hyperiond@root" "hyperion@root" 2> /dev/null
|
|
fi
|
|
# disable user specific symlink
|
|
echo "---> Disable service and remove entry"
|
|
rm -v /etc/systemd/system/hyperion.service /etc/systemd/system/hyperiond@.service /etc/systemd/system/hyperion@.service 2> /dev/null
|
|
|
|
elif [ -e /sbin/initctl ]
|
|
then
|
|
# upstart
|
|
echo "---> stop init deamon: upstart"
|
|
$HYPERION_RUNNING && initctl stop hyperiond
|
|
$HYPERION_RUNNING && initctl stop hyperion
|
|
echo "---> Remove upstart service"
|
|
rm -v /etc/init/hyperion* 2>/dev/null
|
|
initctl reload-configuration
|
|
|
|
else
|
|
# sysV
|
|
echo "---> stop init deamon: sysV"
|
|
$HYPERION_RUNNING && service hyperiond stop 2> /dev/null
|
|
$HYPERION_RUNNING && service hyperion stop 2> /dev/null
|
|
echo "---> Remove sysV service"
|
|
update-rc.d -f hyperion remove
|
|
rm /etc/init.d/hyperion* 2>/dev/null
|
|
fi
|
|
|
|
# In case we don't use a service kill all instances
|
|
killall hyperiond 2> /dev/null
|
|
|
|
echo "---> Remove Hyperion desktop icons"
|
|
# remove desktop/appstream file
|
|
rm -v /usr/share/applications/hyperion* 2> /dev/null
|
|
rm -v /usr/share/metainfo/hyperion* 2> /dev/null
|
|
|
|
# remove Hyperion icons
|
|
rm -v /usr/share/icons/hicolor/*/apps/hyperion.png 2> /dev/null
|
|
|
|
# update desktop-database (if exists)
|
|
if [ -x "$(command -v update-desktop-database)" ]; then
|
|
update-desktop-database -q /usr/share/applications
|
|
update-desktop-database -q /usr/share/icons/hicolor/
|
|
fi
|
|
|
|
exit 0
|