diff --git a/bin/install_hyperion.sh b/bin/install_hyperion.sh index 40ae503a..aedafb2c 100755 --- a/bin/install_hyperion.sh +++ b/bin/install_hyperion.sh @@ -13,6 +13,10 @@ if [ "$1" = "WS281X" ] || [ "$2" = "WS281X" ]; then PWM=1 else PWM=0 fi +if [ "$1" = "USB" ] || [ "$2" = "USB" ]; then + USB=1 +else USB=0 +fi #Check if HyperCon is logged in as root if [ $(id -u) != 0 ] && [ $HCInstall -eq 1 ]; then @@ -231,6 +235,14 @@ elif [ $USE_SYSTEMD -eq 1 ]; then sed -i 's/User=osmc/User=root/g' /etc/systemd/system/hyperion.service sed -i 's/Group=osmc/Group=root/g' /etc/systemd/system/hyperion.service systemctl -q daemon-reload + elif [ $USB -eq 1 ] && [ $OS_OSMC -eq 1 ]; then + echo '---> Modify systemd script for OSMC usage (USB Support)' + # Wait until kodi is sarted (for xbmc checker) and FIX user in case it is wrong (need root for access to USB!)! + sed -i '/After = mediacenter.service/d' /etc/systemd/system/hyperion.service + sed -i '/Unit/a After = mediacenter.service' /etc/systemd/system/hyperion.service + sed -i 's/User=osmc/User=root/g' /etc/systemd/system/hyperion.service + sed -i 's/Group=osmc/Group=root/g' /etc/systemd/system/hyperion.service + systemctl -q daemon-reload elif [ $OS_OSMC -eq 1 ]; then echo '---> Modify systemd script for OSMC usage' # Wait until kodi is sarted (for xbmc checker) and replace user (for remote control through osmc)