Skip to content

Instantly share code, notes, and snippets.

@timanrebel
Created April 10, 2016 15:56
Show Gist options
  • Save timanrebel/a72a9383cd187745fe392893c97dde67 to your computer and use it in GitHub Desktop.
Save timanrebel/a72a9383cd187745fe392893c97dde67 to your computer and use it in GitHub Desktop.
Install pibus on OSMC
#!/bin/bash
HOMEDIR="/home/osmc"
apt-get -y update
apt-get -y upgrade
apt-get -y install cron psmisc
crontab -l | grep pibus > /dev/null
if [ $? != "0" ]; then
crontab <<EOF
@reboot ${HOMEDIR}/pibus -m -c22 -v4
EOF
else
echo -e "autostart.sh already contains pibus - \033[31mskipping.\033[m"
fi
# ----------------
cd ${HOMEDIR}
rm -f pibus-latest.zip
wget http://pibus.info/sw/pibus-latest.zip
if [ $? != "0" ]; then
echo -e "\033[31mDownload failed. Connected to the internet?\033[m"
exit 1
fi
killall pibus
unzip -o pibus-latest.zip pibus
chmod +x ${HOMEDIR}/pibus
# ----------------
if [ -e "${HOMEDIR}/.kodi/addons/skin.mimic.xs" ]; then
echo -e "skin.mimic.xs already exists - \033[31mskipping.\033[m"
else
rm -f master.zip
wget https://github.com/timanrebel/skin.mimic.xs/archive/master.zip
cd ${HOMEDIR}/.kodi/addons
unzip -o ${HOMEDIR}/master.zip
cd ${HOMEDIR}
fi
# ----------------
grep "^dtoverlay=hifiberry-dac" /boot/config.txt > /dev/null
if [ $? != "0" ]; then
echo "adding hifiberry-dac to config.txt"
mount -o remount,rw /boot
echo "dtoverlay=hifiberry-dac" >> /boot/config.txt
mount -o remount,ro /boot
else
echo -e "DAC already configured in config.txt - \033[31mskipping\033[m"
fi
# ----------------
dmesg | grep "Raspberry.Pi.3"
if [ $? == "0" ]; then
grep "^dtoverlay=pi3-miniuart-bt" /boot/config.txt > /dev/null
if [ $? != "0" ]; then
echo "adding pi3-miniuart-bt to config.txt"
mount -o remount,rw /boot
echo "dtoverlay=pi3-miniuart-bt" >> /boot/config.txt
mount -o remount,ro /boot
else
echo -e "UART already configured in config.txt - \033[31mskipping\033[m"
fi
fi
# ----------------
echo -e ""
echo -e "If you want to edit the autostart flags: \033[1;34msudo crontab -e\033[m"
echo -e ""
echo -e "To see a list of possible flags : \033[1;34m${HOMEDIR}/pibus -h\033[m"
echo -e ""
echo -e "\033[32mdone.\033[m Now type \033[31mreboot\033[m and choose the skin.mimic.xs skin in the appearance menu."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment