#!/bin/bash -x # Installs IIAB. "bash -x" (xtrace) is like -v (verbose) but expands commands. # 1. RUN: "sudo su -" then "raspi-config" to set "Localisation Options" # 2. OPTIONAL: "passwd pi; touch /boot/ssh; reboot" to ssh in immediately # 3. RUN THIS SCRIPT: curl download.iiab.io/6.4/rpi/load-prep.txt | bash set -e # to exit on error (avoids snowballing) tune2fs -m 1 /dev/mmcblk0p2 # Above changes reserve disk space from ~5% to 1% export DEBIAN_FRONTEND=noninteractive apt update apt -y dist-upgrade apt -y clean # Above updates Raspbian for security especially wget https://download.teamviewer.com/download/linux/teamviewer-host_armhf.deb set +e # do not exit when "dpkg -i" below inevitably fails dpkg -i teamviewer-host_armhf.deb set -e apt -y -f install # fix dependencies for above/failed "dpkg -i" rm teamviewer-host_armhf.deb apt -y install git ansible emacs lynx bc # Above installs a more future-proof Ansible 2.2.1+, and git for Raspbian Lite sed -i 's/StrictVersion/LooseVersion/g' /usr/lib/python2.7/dist-packages/ansible/modules/core/web_infrastructure/htpasswd.py # ABOVE APPLIES TEMPORARY PATCH https://github.com/ansible/ansible/pull/20202 # needed by munin until Ansible 2.3.2 or 2.4.0, to overcome Ansible bug: # TASK [munin : Create admin user] ******************************** # fatal: [127.0.0.1]: FAILED! => {"changed": false, "failed": true, # "msg": "invalid version number '1.7.0.post20170423015547'"}