2016-03-08 18:20:09 +01:00
|
|
|
#!/bin/sh
|
|
|
|
# Script to remove Hyperion and all services
|
|
|
|
|
|
|
|
# Make sure /sbin is on the path (for service to find sub scripts)
|
|
|
|
PATH="/sbin:$PATH"
|
|
|
|
|
|
|
|
#Check if HyperCon is logged in as root
|
|
|
|
if [ $(id -u) != 0 ] && [ "$1" = "HyperConRemove" ]; then
|
2016-05-26 23:44:27 +02:00
|
|
|
echo '---> Critical Error: Please connect as user "root" through HyperCon'
|
|
|
|
echo '---> We need admin privileges to remove your Hyperion! -> abort'
|
|
|
|
exit 1
|
2016-03-08 18:20:09 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
#Check, if script is running as root
|
|
|
|
if [ $(id -u) != 0 ]; then
|
2016-05-26 23:44:27 +02:00
|
|
|
echo '---> Critical Error: Please run the script as root (sudo sh ./remove_hyperion.sh)'
|
|
|
|
exit 1
|
2016-03-08 18:20:09 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
#Welcome message
|
|
|
|
echo '*******************************************************************************'
|
add Hue EntertainmentAPI + Forwarder & other Fixes (#592)
* whitespaces + typo fixes
* JS / LGTM fixes
* SSDP Handler crash fix
* MessageForwarder handlePriorityChanges Slave fixes
* use aboutToQuit Signal
* complete rewriten Hue Entertainment API structure
combined Philips Hue and Entertainment API
with new MbedTLS based SSL UDP Provider
* add required cross-compile submodules
* logical rebuild fn: initLeds, setLights + new logs
-more detailed checks and error handling inside iniLeds and setLights
- logical script procedure before ProviderUdpSSL init
- first steps for multiple ProviderUdpSSL usage
- better fallback support to old RestAPI, if entertainment api is not supported
- just 4 u LordGrey: new log fn for cosmetic config outputs ;)
* add OSX CompileHowTo - undo from CrossCompileHowTo
* whitespace fixes
* lightID toString fix
* fix unsigned int E-API + debug output
* bugfixes, reworked black signal detection, wizard:
- change device config field light-ids from int to string -> real unsigned int fix
- add signal detection brightness minimum threshold value
0.0 for 0% brightness - 1.0 for 100% brightness to count for blacklight signal detection
reason: input may not 100% black, like mine - i have a deep dark gray input signal
-> my threshold value is set to 0.005 for 0.5% minimum brightness = 1 (from max 255) to count as black
- wizard optimations, with fallback without entertainment support (beta state)
- whitespace fixes
* cleanup + minor fixes
* change fixed Hue UPD SSL config to _devConfig paras
* Hotfix SSL Connection, new light models, wizard:
- Fix UPD SSL Connection failed Problems
- add new supported gamut C light models: LCG002, LCA001, LCA002, LCA003
- wizard: extend fallback support to classic mode + hints
* whitespace, typo fix
* uncheck useEntertainmentAPI, if noAPISupport detected + hint
* coredump fix -> add _blackLightsTimer nullptr init
* code cleanup / remove old debugs + whitespacefixes
* add gamut C LCP001, LCP002
* SSL UDP config made more flexible + remove qDebug
-> switch to hyerion.ng _log
-> replace logCommand with verbose
-> code cleanups etc...
* extended mbedtls debugging infos
* add adjustable ssl timeout settings
* error handling
* streamdebugger bugfixes
* UPDSSL psk / psk_identity bugfixes! + hue wizard fn typo fix +
- verbose option available without dependencies
- whitespace fixes
* Philips Hue Assistant now recognizes non-original bridges better...
+ Added note if no clientkey is set when using the entertainment API
+ User creation (+ clientkey) for non-original bridges can now also be used
+ Minor changes and bug fixes
* CMAKE mbedTLS detection
* minor bug fixes + code cleanups
* FindMbedTLS.cmake remove Path-Hints + wizard.js: ajax timeout handling
Test - content_grabber.js: run relevant code only, if V4L2_AVAIL is true:
conf_grabber don't displays other devices, if V4L2 is not available
* compile mbedtls via cmake as static lib
* remove libmbedtls-dev from compileHowto / scripts
* Fix Windows build
* Fix windows build (part 2)
* removed unnecessary osx x11 include directory path
* QTimer Shutdown bugfix
* cmake win32 fix + minor bugfixes
* cmake debug msg used mbedtls libs
* Bugfix: noSignalDetection wasn't switchedOn again
if no signal was previously detected
* Some code fixes based on alerts from lgtm.com
Co-authored-by: Paulchen Panther <16664240+Paulchen-Panther@users.noreply.github.com>
2020-05-22 19:40:50 +02:00
|
|
|
echo 'This script will remove Hyperion and its services'
|
2016-03-08 18:20:09 +01:00
|
|
|
echo '-----> Please BACKUP your hyperion.config.json if necessary <-----'
|
2016-04-26 12:27:59 +02:00
|
|
|
echo 'Created by brindosch - hyperion-project.org - the official Hyperion source.'
|
2016-03-08 18:20:09 +01:00
|
|
|
echo '*******************************************************************************'
|
|
|
|
|
|
|
|
#Skip the prompt if HyperCon Remove
|
|
|
|
if [ "$1" = "" ]; then
|
2016-05-26 23:44:27 +02:00
|
|
|
#Prompt for confirmation to proceed
|
|
|
|
while true
|
|
|
|
do
|
add Hue EntertainmentAPI + Forwarder & other Fixes (#592)
* whitespaces + typo fixes
* JS / LGTM fixes
* SSDP Handler crash fix
* MessageForwarder handlePriorityChanges Slave fixes
* use aboutToQuit Signal
* complete rewriten Hue Entertainment API structure
combined Philips Hue and Entertainment API
with new MbedTLS based SSL UDP Provider
* add required cross-compile submodules
* logical rebuild fn: initLeds, setLights + new logs
-more detailed checks and error handling inside iniLeds and setLights
- logical script procedure before ProviderUdpSSL init
- first steps for multiple ProviderUdpSSL usage
- better fallback support to old RestAPI, if entertainment api is not supported
- just 4 u LordGrey: new log fn for cosmetic config outputs ;)
* add OSX CompileHowTo - undo from CrossCompileHowTo
* whitespace fixes
* lightID toString fix
* fix unsigned int E-API + debug output
* bugfixes, reworked black signal detection, wizard:
- change device config field light-ids from int to string -> real unsigned int fix
- add signal detection brightness minimum threshold value
0.0 for 0% brightness - 1.0 for 100% brightness to count for blacklight signal detection
reason: input may not 100% black, like mine - i have a deep dark gray input signal
-> my threshold value is set to 0.005 for 0.5% minimum brightness = 1 (from max 255) to count as black
- wizard optimations, with fallback without entertainment support (beta state)
- whitespace fixes
* cleanup + minor fixes
* change fixed Hue UPD SSL config to _devConfig paras
* Hotfix SSL Connection, new light models, wizard:
- Fix UPD SSL Connection failed Problems
- add new supported gamut C light models: LCG002, LCA001, LCA002, LCA003
- wizard: extend fallback support to classic mode + hints
* whitespace, typo fix
* uncheck useEntertainmentAPI, if noAPISupport detected + hint
* coredump fix -> add _blackLightsTimer nullptr init
* code cleanup / remove old debugs + whitespacefixes
* add gamut C LCP001, LCP002
* SSL UDP config made more flexible + remove qDebug
-> switch to hyerion.ng _log
-> replace logCommand with verbose
-> code cleanups etc...
* extended mbedtls debugging infos
* add adjustable ssl timeout settings
* error handling
* streamdebugger bugfixes
* UPDSSL psk / psk_identity bugfixes! + hue wizard fn typo fix +
- verbose option available without dependencies
- whitespace fixes
* Philips Hue Assistant now recognizes non-original bridges better...
+ Added note if no clientkey is set when using the entertainment API
+ User creation (+ clientkey) for non-original bridges can now also be used
+ Minor changes and bug fixes
* CMAKE mbedTLS detection
* minor bug fixes + code cleanups
* FindMbedTLS.cmake remove Path-Hints + wizard.js: ajax timeout handling
Test - content_grabber.js: run relevant code only, if V4L2_AVAIL is true:
conf_grabber don't displays other devices, if V4L2 is not available
* compile mbedtls via cmake as static lib
* remove libmbedtls-dev from compileHowto / scripts
* Fix Windows build
* Fix windows build (part 2)
* removed unnecessary osx x11 include directory path
* QTimer Shutdown bugfix
* cmake win32 fix + minor bugfixes
* cmake debug msg used mbedtls libs
* Bugfix: noSignalDetection wasn't switchedOn again
if no signal was previously detected
* Some code fixes based on alerts from lgtm.com
Co-authored-by: Paulchen Panther <16664240+Paulchen-Panther@users.noreply.github.com>
2020-05-22 19:40:50 +02:00
|
|
|
echo -n "---> Do you really want to remove Hyperion and its services? (y or n) :"
|
2016-05-26 23:44:27 +02:00
|
|
|
read CONFIRM
|
|
|
|
case $CONFIRM in
|
|
|
|
y|Y|YES|yes|Yes) break ;;
|
|
|
|
n|N|no|NO|No)
|
|
|
|
echo "---> Aborting - you entered \"$CONFIRM\""
|
|
|
|
exit
|
|
|
|
;;
|
|
|
|
*) echo "-> Please enter only y or n"
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
echo "---> You entered \"$CONFIRM\". Remove Hyperion!"
|
2016-03-08 18:20:09 +01:00
|
|
|
fi
|
2016-06-10 18:32:39 +02:00
|
|
|
|
2016-05-04 18:50:40 +02:00
|
|
|
# Find out if we are on OpenElec or RasPlex
|
2016-05-05 12:55:11 +02:00
|
|
|
OS_OPENELEC=`grep -m1 -c 'OpenELEC\|RasPlex\|LibreELEC' /etc/issue`
|
2016-03-08 18:20:09 +01:00
|
|
|
|
|
|
|
# check which init script we should use
|
|
|
|
USE_SYSTEMD=`grep -m1 -c systemd /proc/1/comm`
|
|
|
|
USE_INITCTL=`which /sbin/initctl | wc -l`
|
|
|
|
USE_SERVICE=`which /usr/sbin/service | wc -l`
|
|
|
|
|
2016-04-26 12:27:59 +02:00
|
|
|
# set count for forwarder
|
|
|
|
SERVICEC=1
|
|
|
|
|
2016-03-08 18:20:09 +01:00
|
|
|
# Stop hyperion daemon if it is running
|
|
|
|
echo '---> Stop Hyperion, if necessary'
|
|
|
|
if [ $OS_OPENELEC -eq 1 ]; then
|
|
|
|
killall hyperiond 2>/dev/null
|
|
|
|
elif [ $USE_INITCTL -eq 1 ]; then
|
|
|
|
/sbin/initctl stop hyperion 2>/dev/null
|
|
|
|
elif [ $USE_SERVICE -eq 1 ]; then
|
|
|
|
/usr/sbin/service hyperion stop 2>/dev/null
|
|
|
|
elif [ $USE_SYSTEMD -eq 1 ]; then
|
|
|
|
service hyperion stop 2>/dev/null
|
|
|
|
fi
|
|
|
|
|
2016-04-26 12:27:59 +02:00
|
|
|
#reset count
|
|
|
|
SERVICEC=`which /usr/sbin/service | wc -l`
|
|
|
|
|
2016-03-08 18:20:09 +01:00
|
|
|
#Disabling and delete service files
|
|
|
|
if [ $USE_INITCTL -eq 1 ]; then
|
|
|
|
echo '---> Delete and disable Hyperion initctl script'
|
2016-04-26 12:27:59 +02:00
|
|
|
rm -v /etc/init/hyperion* 2>/dev/null
|
2016-03-08 18:20:09 +01:00
|
|
|
initctl reload-configuration
|
|
|
|
elif [ $OS_OPENELEC -eq 1 ]; then
|
|
|
|
# Remove Hyperion from OpenELEC autostart.sh
|
|
|
|
echo "---> Remove Hyperion from OpenELEC autostart.sh"
|
|
|
|
sed -i "/hyperiond/d" /storage/.config/autostart.sh 2>/dev/null
|
2016-03-22 01:01:54 +01:00
|
|
|
sed -i "/hyperion-x11/d" /storage/.config/autostart.sh 2>/dev/null
|
2020-08-03 12:31:39 +02:00
|
|
|
sed -i "/hyperion-xcb/d" /storage/.config/autostart.sh 2>/dev/null
|
2016-03-08 18:20:09 +01:00
|
|
|
elif [ $USE_SYSTEMD -eq 1 ]; then
|
|
|
|
# Delete and disable Hyperion systemd script
|
|
|
|
echo '---> Delete and disable Hyperion systemd script'
|
|
|
|
systemctl disable hyperion.service
|
2016-04-26 12:27:59 +02:00
|
|
|
rm -v /etc/systemd/system/hyperion* 2>/dev/null
|
2016-03-08 18:20:09 +01:00
|
|
|
elif [ $USE_SERVICE -eq 1 ]; then
|
|
|
|
# Delete and disable Hyperion init.d script
|
|
|
|
echo '---> Delete and disable Hyperion init.d script'
|
|
|
|
update-rc.d -f hyperion remove
|
2016-04-26 12:27:59 +02:00
|
|
|
rm /etc/init.d/hyperion* 2>/dev/null
|
2016-03-08 18:20:09 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Delete Hyperion binaries
|
|
|
|
if [ $OS_OPENELEC -eq 1 ]; then
|
|
|
|
# Remove OpenELEC Hyperion binaries and configs
|
|
|
|
echo '---> Remove the OpenELEC Hyperion binaries and hyperion.config.json'
|
|
|
|
rm -rv /storage/hyperion 2>/dev/null
|
|
|
|
rm -v /storage/.config/hyperion.config.json 2>/dev/null
|
2020-08-02 22:37:52 +02:00
|
|
|
else
|
2016-03-08 18:20:09 +01:00
|
|
|
#Remove binaries on all distributions/systems (not OpenELEC)
|
2020-08-02 22:37:52 +02:00
|
|
|
echo "---> Remove links to the binaries"
|
2016-03-08 18:20:09 +01:00
|
|
|
rm -v /usr/bin/hyperiond 2>/dev/null
|
|
|
|
rm -v /usr/bin/hyperion-remote 2>/dev/null
|
|
|
|
rm -v /usr/bin/hyperion-v4l2 2>/dev/null
|
2016-03-13 15:40:49 +01:00
|
|
|
rm -v /usr/bin/hyperion-dispmanx 2>/dev/null
|
|
|
|
rm -v /usr/bin/hyperion-x11 2>/dev/null
|
2020-08-03 12:31:39 +02:00
|
|
|
rm -v /usr/bin/hyperion-xcb 2>/dev/null
|
2016-06-10 18:32:39 +02:00
|
|
|
rm -v /usr/bin/hyperion-aml 2>/dev/null
|
2016-03-08 18:20:09 +01:00
|
|
|
rm -v /etc/hyperion.config.json 2>/dev/null
|
|
|
|
echo "---> Remove binaries"
|
|
|
|
rm -rv /opt/hyperion 2>/dev/null
|
2016-06-10 18:32:39 +02:00
|
|
|
rm -rv /etc/hyperion 2>/dev/null
|
|
|
|
rm -rv /usr/share/hyperion 2>/dev/null
|
2016-03-08 18:20:09 +01:00
|
|
|
fi
|
2020-08-02 22:37:52 +02:00
|
|
|
echo '*******************************************************************************'
|
2016-03-08 18:20:09 +01:00
|
|
|
echo 'Hyperion successful removed!'
|
2020-08-02 22:37:52 +02:00
|
|
|
echo '*******************************************************************************'
|
2016-03-08 18:20:09 +01:00
|
|
|
exit 0
|
2020-08-02 22:37:52 +02:00
|
|
|
|