mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
even more changes
Signed-off-by: Paulchen-Panther <Paulchen--Panter@gmx.net>
This commit is contained in:
40
cmake/debian/prerm
Normal file
40
cmake/debian/prerm
Normal file
@@ -0,0 +1,40 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo "---Hyperion ambient light prerm ---"
|
||||
|
||||
# search for users in system, returns first entry
|
||||
FOUND_USR=`who | grep -o '^\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
|
||||
echo "--> stop init deamon: systemd"
|
||||
# systemd
|
||||
$HYPERION_RUNNING && systemctl stop hyperiond"@${FOUND_USR}" 2> /dev/null
|
||||
# disable user specific symlink
|
||||
echo "--> Disable service and remove entry"
|
||||
systemctl -q disable hyperiond"@${FOUND_USR}"
|
||||
rm -v /etc/systemd/system/hyperiond@.service 2>/dev/null
|
||||
|
||||
elif [ -e /sbin/initctl ]
|
||||
then
|
||||
echo "--> stop init deamon: upstart"
|
||||
# upstart
|
||||
$HYPERION_RUNNING && initctl stop hyperiond
|
||||
echo "--> Remove upstart service"
|
||||
rm -v /etc/init/hyperion* 2>/dev/null
|
||||
initctl reload-configuration
|
||||
|
||||
else
|
||||
echo "--> stop init deamon: sysV"
|
||||
# sysV
|
||||
$HYPERION_RUNNING && service hyperiond stop 2>/dev/null
|
||||
echo "--> Remove sysV service"
|
||||
update-rc.d -f hyperion remove
|
||||
rm /etc/init.d/hyperion* 2>/dev/null
|
||||
fi
|
||||
|
||||
return 0
|
Reference in New Issue
Block a user