From 8111d320e3f1574c7602cc43a6cf9a0622922145 Mon Sep 17 00:00:00 2001 From: brindosch Date: Sat, 2 Apr 2016 01:24:08 +0200 Subject: [PATCH] extend install-hyperion.sh Former-commit-id: f330c1b9d292529b82541ca7b727ec2269e1e9dc --- bin/install_hyperion.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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)