mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Release 2.0.12
This commit is contained in:
@@ -2,26 +2,29 @@
|
||||
|
||||
echo "---Hyperion ambient light preinst ---"
|
||||
|
||||
# search for users in system, returns first entry
|
||||
FOUND_USR=`who | grep -o -m1 '^\w*\b'` || "root"
|
||||
|
||||
# stop running daemon before we install/upgrade
|
||||
if pgrep hyperiond > /dev/null 2>&1
|
||||
then
|
||||
if grep -m1 systemd /proc/1/comm > /dev/null
|
||||
then
|
||||
echo "--> stop init deamon: systemd"
|
||||
# systemd
|
||||
systemctl stop hyperion hyperiond"@${FOUND_USR}" hyperion"@${FOUND_USR}" "hyperiond@root" "hyperion@root" 2> /dev/null
|
||||
echo "--> stop init deamon: systemd"
|
||||
CURRENT_SERVICE=$(systemctl list-units --all | { grep -o "hyperion*.*\.service" || true; })
|
||||
if [ ! -z ${CURRENT_SERVICE} ]; then
|
||||
systemctl stop "${CURRENT_SERVICE}" 2> /dev/null
|
||||
else
|
||||
FOUND_USR=`who | grep -o -m1 '^\w*\b'` || "root"
|
||||
systemctl stop hyperion hyperiond"@${FOUND_USR}" hyperion"@${FOUND_USR}" "hyperiond@root" "hyperion@root" 2> /dev/null
|
||||
fi
|
||||
elif [ -e /sbin/initctl ]
|
||||
then
|
||||
echo "--> stop init deamon: upstart"
|
||||
# upstart
|
||||
echo "--> stop init deamon: upstart"
|
||||
initctl stop hyperiond 2>/dev/null
|
||||
initctl stop hyperion 2>/dev/null
|
||||
else
|
||||
echo "--> stop init deamon: sysV"
|
||||
# sysV
|
||||
echo "--> stop init deamon: sysV"
|
||||
service hyperiond stop 2>/dev/null
|
||||
service hyperion stop 2>/dev/null
|
||||
fi
|
||||
|
Reference in New Issue
Block a user