diff --git a/tools/pi/autorun b/tools/pi/autorun index 8a750ea..65c8d9f 100755 --- a/tools/pi/autorun +++ b/tools/pi/autorun @@ -2,7 +2,7 @@ # deactivate power saving: for cpu in /sys/devices/system/cpu/cpu[0-9]*; do echo -n performance \ -| sudo tee $cpu/cpufreq/scaling_governor; done + | sudo tee $cpu/cpufreq/scaling_governor; done ## Stop the ntp service #sudo service ntp stop @@ -42,72 +42,73 @@ if test -e /boot/ovclient-wifi.txt; then test -e /boot/ovclient-country.txt && COUNTRYCODE=$(cat /boot/ovclient-country.txt) echo "connecting to WiFi ${SSID}" if test -n "${SSID}"; then - sudo raspi-config nonint do_wifi_country "${COUNTRYCODE}" - sleep 2 - rfkill unblock wifi - sleep 10 - sudo raspi-config nonint do_wifi_ssid_passphrase "${SSID}" "${PW}" - sleep 20 + sudo raspi-config nonint do_wifi_country "${COUNTRYCODE}" + sleep 2 + rfkill unblock wifi + sleep 10 + sudo raspi-config nonint do_wifi_ssid_passphrase "${SSID}" "${PW}" + sleep 20 fi fi if test ! -e /boot/ovclient-noupdate; then # if not on overlayfs then update/reinstall: if (cat /proc/mounts | grep -e " / ")|grep -q -e overlay; then - echo "overlay fs, not updating" + echo "overlay fs, not updating" else - # get the latest installer script: - . /usr/share/ovclient/tools/installovclient.sh + # get the latest installer script: + . /usr/share/ovclient/tools/installovclient.sh # test for openMHA install request: if test -e /boot/ov-client-instmha; then rm -f /boot/ov-client-instmha sudo apt install --no-install-recommends --assume-yes openmha openmha-examples fi - # activate overlay image in case the installation script failed, and try the best we can: - sudo raspi-config nonint enable_overlayfs - # ready, reboot: - sudo shutdown -r now + # activate overlay image in case the installation script failed, and try the best we can: + sudo raspi-config nonint enable_overlayfs + # ready, reboot: + sudo shutdown -r now fi fi + # start client: while true; do - sudo su -l ov -c "ov-client" || sudo touch ~ov/ov-client.firmwareupdate + sudo su -l ov -c "ov-client" # test for modified configuration: if test -e ~ov/ov-client.cfg; then - sudo mv ~ov/ov-client.cfg /boot/ - sync + sudo mv ~ov/ov-client.cfg /boot/ + sync fi # test for firmware update: if test -e ~ov/ov-client.firmwareupdate; then - # firmware update requested: disable overlayfs and restart - sudo rm -f ~ov/ov-client.firmwareupdate - sudo raspi-config nonint disable_overlayfs - sudo shutdown -r now + # firmware update requested: disable overlayfs and restart + sudo rm -f ~ov/ov-client.firmwareupdate + sudo raspi-config nonint disable_overlayfs + sudo shutdown -r now fi # test for openMHA install request: if test -e ~ov/ov-client.installopenmha; then - # firmware update requested: disable overlayfs and restart - sudo rm -f ~ov/ov-client.installopenmha + # firmware update requested: disable overlayfs and restart + sudo rm -f ~ov/ov-client.installopenmha sudo touch /boot/ov-client-instmha - sudo raspi-config nonint disable_overlayfs - sudo shutdown -r now + sudo raspi-config nonint disable_overlayfs + sudo shutdown -r now fi # check for development version: if test -e ~ov/ov-client.usedevversion; then - echo "switching to development version" - # switch to development version: - sudo rm -f ~ov/ov-client.usedevversion - # identify OS release code name: - OSREL=`lsb_release -a|grep Codename|sed 's/Codename:[[:blank:]]*//1'` - OSRELHTCH="$OSREL" - if test "$OSREL" = "buster"; then - OSRELHTCH=bionic - fi - (echo "";echo "deb [arch=armhf] http://aptdev.hoertech.de ${OSRELHTCH} universe")|sudo tee -a /etc/apt/sources.list - sudo apt update --assume-yes - sudo apt install --no-install-recommends --assume-yes ov-client + echo "switching to development version" + # switch to development version: + sudo rm -f ~ov/ov-client.usedevversion + # identify OS release code name: + OSREL=`lsb_release -a|grep Codename|sed 's/Codename:[[:blank:]]*//1'` + OSRELHTCH="$OSREL" + if test "$OSREL" = "buster"; then + OSRELHTCH=bionic + fi + (echo "";echo "deb [arch=armhf] http://aptdev.hoertech.de ${OSRELHTCH} universe")|sudo tee -a /etc/apt/sources.list + sudo apt update --assume-yes + sudo apt install --no-install-recommends --assume-yes ov-client fi if test -e ~ov/ov-client.wificfg; then echo "switching wifi"