TEXT   13

load-min-vpn.txt

Guest on 19th May 2021 11:25:07 AM

  1. #!/bin/bash -x
  2. # Installs IIAB. "bash -x" (xtrace) is like -v (verbose) but expands commands.
  3.  
  4. # 1. RUN: "sudo su -" then "raspi-config" to set "Localisation Options"
  5. # 2. OPTIONAL: "passwd pi; touch /boot/ssh; reboot" to ssh in immediately
  6. # 3. RUN THIS SCRIPT: curl download.iiab.io/6.5/load-min-vpn.txt | bash
  7. # 4. REBOOTS AUTOMATICALLY WHEN DONE (about 1 hour later) which
  8. #    sets the hostname, while improving RTC settings + memory mgmt
  9. # 5. Run "teamviewer help" to get your TeamViewer ID and set a passwd
  10. # 6. Set /etc/iiab/handle if you use openvpn@xscenet
  11.  
  12. set -e                    # to exit on error (avoids snowballing)
  13.  
  14. if grep -qi raspbian /etc/*release; then tune2fs -m 1 /dev/mmcblk0p2; fi
  15. # If OS is Raspbian, lowers reserve disk space from ~5% to 1%
  16.  
  17. export DEBIAN_FRONTEND=noninteractive
  18. apt update
  19. apt -y dist-upgrade
  20. apt -y clean
  21. # Above updates OS for security especially
  22.  
  23. if grep -qi raspbian /etc/*release; then
  24.     wget https://download.teamviewer.com/download/linux/teamviewer-host_armhf.deb
  25.     apt -y install ./teamviewer-host_armhf.deb git emacs lynx bc
  26.     rm teamviewer-host_armhf.deb
  27. else # Ubuntu, Debian
  28.     wget https://download.teamviewer.com/download/linux/teamviewer_amd64.deb
  29.     apt -y install ./teamviewer_amd64.deb git emacs lynx bc
  30.     rm teamviewer_amd64.deb
  31. fi
  32.  
  33. mkdir -p /opt/iiab
  34. cd /opt/iiab/
  35. git clone https://github.com/iiab/iiab -b release-6.5 --depth 1
  36. git clone https://github.com/iiab/iiab-admin-console --depth 1
  37. git clone https://github.com/iiab/iiab-menu --depth 1
  38. git clone https://github.com/iiab/iiab-factory --depth 1
  39.  
  40. cd /opt/iiab/iiab/vars/
  41. if [ -f local_vars.yml ]; then
  42.     echo "ERROR: Plz move /opt/iiab/iiab/vars/local_vars.yml to proceed." >&2
  43.     exit 1
  44. fi
  45. cp local_vars_min_vpn.yml local_vars.yml
  46. # In general please examine local_vars.yml carefully (and modify as nec)
  47. # before running Ansible (below, which can take 1-to-2 hours the first time!)
  48.  
  49. # NOTE: you can change many/most settings after install too, using the
  50. # Admin Console (http://box/admin) as documented at: http://FAQ.IIAB.IO
  51.  
  52. cd /opt/iiab/iiab/scripts/
  53. ./ansible
  54. # Installs latest Ansible from PPA
  55. # ./ansible-2.4.x
  56. # ./ansible-2.5.x
  57.  
  58. cd /opt/iiab/iiab/
  59. ./iiab-install
  60. # TRY TO RERUN THE ABOVE LINE IF IT FAILS (if networking glitches etc?)
  61.  
  62. cd /opt/iiab/iiab-admin-console/
  63. ./install
  64. # Installs Admin Console; runs iiab-get-kiwix-cat to d/l Kiwix catalog
  65.  
  66. cd /opt/iiab/iiab-menu/
  67. ./cp-menus
  68. # Installs Dynamic Menuing for /library/www/html/home/index.html
  69.  
  70. iiab-make-kiwix-lib
  71. # Rebuilds local library.xml in case ZIM files added to /library/zims/content
  72.  
  73. export KALITE_HOME=/library/ka-lite
  74. kalite manage generate_zone
  75. # Register with KA Lite - just the anonymous registration
  76. kalite manage retrievecontentpack download en
  77. # Get KA Lite English language pack (slow download!)
  78.  
  79. reboot

Raw Paste


Login or Register to edit or fork this paste. It's free.