#!/bin/bash -x # Start loading IIAB. "bash -x" is debug mode set -e # "set -e" to exit on error (avoids snowballing) # RUN "raspi-config" TO SET ALL 4 "LOCALISATION" OPTIONS! # ALSO CONSIDER: "passwd pi; touch /boot/ssh; reboot" to ssh in immediately # THEN: time curl download.iiab.io/6.4/rpi/load-min.txt | bash apt -y clean; apt -y autoremove echo -e "\nBeginning:" >> /root/disk.log date >> /root/disk.log; df -m >> /root/disk.log export DEBIAN_FRONTEND=noninteractive apt update apt -y dist-upgrade # Above updates Raspbian for security especially apt -y clean; apt -y autoremove echo -e "\nraspbian update + dist-upgrade done:" >> /root/disk.log date >> /root/disk.log; df -m >> /root/disk.log 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 # Later run "teamviewer help" to get your TeamViewer ID and set a passwd apt -y clean; apt -y autoremove echo -e "\nteamviewer-host installed:" >> /root/disk.log date >> /root/disk.log; df -m >> /root/disk.log apt -y install emacs apt -y clean; apt -y autoremove echo -e "\nemacs installed:" >> /root/disk.log date >> /root/disk.log; df -m >> /root/disk.log apt -y install lynx apt -y clean; apt -y autoremove echo -e "\nlynx installed:" >> /root/disk.log date >> /root/disk.log; df -m >> /root/disk.log apt -y install bc apt -y clean; apt -y autoremove echo -e "\nbc installed:" >> /root/disk.log date >> /root/disk.log; df -m >> /root/disk.log apt -y install git # Above for Raspbian Lite; USE "apt remove" OR "apt purge" ON UNNEEDED SW LATER apt -y clean; apt -y autoremove echo -e "\ngit installed:" >> /root/disk.log date >> /root/disk.log; df -m >> /root/disk.log mkdir -p /opt/iiab cd /opt/iiab/ git clone https://github.com/iiab/iiab --depth 1 git clone https://github.com/iiab/iiab-admin-console --depth 1 git clone https://github.com/iiab/iiab-menu --depth 1 git clone https://github.com/iiab/iiab-factory --depth 1 apt -y clean; apt -y autoremove echo -e "\n4 git clone's done:" >> /root/disk.log date >> /root/disk.log; df -m >> /root/disk.log cd /opt/iiab/iiab/scripts/ ./ansible # Installs the correct version of Ansible apt -y clean; apt -y autoremove echo -e "\nansible 2.2.0.0 installed:" >> /root/disk.log date >> /root/disk.log; df -m >> /root/disk.log cd /opt/iiab/iiab/vars/ if [ -f local_vars.yml ]; then echo "ERROR: Plz move /opt/iiab/iiab/vars/local_vars.yml to proceed." >&2 exit 1 elif [ -f local_vars_min.yml ]; then echo "ERROR: Plz move /opt/iiab/iiab/vars/local_vars_min.yml to proceed." >&2 exit 1 fi wget http://download.iiab.io/6.4/rpi/local_vars_min.yml mv local_vars_min.yml local_vars.yml # Above assumes a virgin RPi system (wget WON'T overwrite existing files) # In general please examine local_vars.yml carefully (and modify as nec) # before running Ansible (below, which can take ~2 hours the first time!) # NOTE: you can change many/most settings after install too, using the # Admin Console (http://box/admin) as documented at: http://FAQ.IIAB.IO cd /opt/iiab/iiab/ ./runansible # Try to rerun the above line if it fails? apt -y clean; apt -y autoremove echo -e "\nrunansible completed:" >> /root/disk.log date >> /root/disk.log; df -m >> /root/disk.log cd /opt/iiab/iiab-admin-console/ ./install apt -y clean; apt -y autoremove echo -e "\niiab-admin-console installed:" >> /root/disk.log date >> /root/disk.log; df -m >> /root/disk.log cd /opt/iiab/iiab-menu/ ./cp-menus apt -y clean; apt -y autoremove echo -e "\niiab-menu installed:" >> /root/disk.log date >> /root/disk.log; df -m >> /root/disk.log # SET /etc/iiab/handle IF YOU USE openvpn@xscenet AND REGARDLESS REBOOT # which also helps set host name & improve RTC settings + memory management