extend install-hyperion.sh

This commit is contained in:
brindosch 2016-04-02 01:24:08 +02:00
parent b6095d193c
commit f330c1b9d2
1 changed files with 12 additions and 0 deletions

View File

@ -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)