BASH   17

load.txt

Guest on 19th May 2021 11:29:51 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.txt | bash
  7. # 4. REBOOTS AUTOMATICALLY WHEN DONE (about 1.5 hours later) which
  8. #    sets the hostname, while improving RTC settings + memory mgmt
  9.  
  10. set -e                    # to exit on error (avoids snowballing)
  11.  
  12. if grep -qi raspbian /etc/*release; then tune2fs -m 1 /dev/mmcblk0p2; fi
  13. # If OS is Raspbian, lowers reserve disk space from ~5% to 1%
  14.  
  15. export DEBIAN_FRONTEND=noninteractive
  16. apt update
  17. apt -y dist-upgrade
  18. apt -y clean
  19. # Above updates OS for security especially
  20.  
  21. apt -y install git
  22.  
  23. mkdir -p /opt/iiab
  24. cd /opt/iiab/
  25. git clone https://github.com/iiab/iiab -b release-6.5 --depth 1
  26. git clone https://github.com/iiab/iiab-admin-console --depth 1
  27. git clone https://github.com/iiab/iiab-menu --depth 1
  28. git clone https://github.com/iiab/iiab-factory --depth 1
  29.  
  30. cd /opt/iiab/iiab/vars/
  31. if [ -f local_vars.yml ]; then
  32.     echo "ERROR: Plz move /opt/iiab/iiab/vars/local_vars.yml to proceed." >&2
  33.     exit 1
  34. fi
  35. cp local_vars_medium.yml local_vars.yml
  36. # In general please examine local_vars.yml carefully (and modify as nec)
  37. # before running Ansible (below, which can take 1-to-2 hours the first time!)
  38.  
  39. # NOTE: you can change many/most settings after install too, using the
  40. # Admin Console (http://box/admin) as documented at: http://FAQ.IIAB.IO
  41.  
  42. cd /opt/iiab/iiab/scripts/
  43. ./ansible
  44. # Installs latest Ansible from PPA
  45. # ./ansible-2.4.x
  46. # ./ansible-2.5.x
  47.  
  48. cd /opt/iiab/iiab/
  49. ./iiab-install
  50. # TRY TO RERUN THE ABOVE LINE IF IT FAILS (if networking glitches etc?)
  51.  
  52. cd /opt/iiab/iiab-admin-console/
  53. ./install
  54. # Installs Admin Console; runs iiab-get-kiwix-cat to d/l Kiwix catalog
  55.  
  56. cd /opt/iiab/iiab-menu/
  57. ./cp-menus
  58. # Installs Dynamic Menuing for /library/www/html/home/index.html
  59.  
  60. iiab-make-kiwix-lib
  61. # Rebuilds local library.xml in case ZIM files added to /library/zims/content
  62.  
  63. export KALITE_HOME=/library/ka-lite
  64. kalite manage generate_zone
  65. # Register with KA Lite - just the anonymous registration
  66. kalite manage retrievecontentpack download en
  67. # Get KA Lite English language pack (slow download!)
  68.  
  69. reboot

Raw Paste


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