diff --git a/roles/httpd/templates/refresh-wiki-docs.sh b/roles/httpd/templates/refresh-wiki-docs.sh index 46e153bb1..32e9ebf12 100755 --- a/roles/httpd/templates/refresh-wiki-docs.sh +++ b/roles/httpd/templates/refresh-wiki-docs.sh @@ -1,17 +1,23 @@ #!/bin/bash -x -# Pull down repo's entire wiki (and similar) to create offline docs +# This /opt/iiab/iiab/roles/httpd/templates/refresh-wiki-docs.sh becomes +# /usr/bin/iiab-refresh-wiki-docs during IIAB's install. -set -e -source {{ iiab_env_file }} +# This pulls down iiab/iiab repo's entire Tech Docs Wiki (and scrapes/downloads +# other docs!) to create IIAB's offline docs collection: http://box/info + +set -e # Exit on error (avoids snowballing) +source {{ iiab_env_file }} # /etc/iiab/iiab.env INPUT=/tmp/iiab-wiki OUTPUT=/tmp/iiab-wiki.out -DESTPATH=/library/www/html/info +DESTPATH={{ doc_root }}/info # /library/www/html/info +DOCSPATH=$DESTPATH/docs # /library/www/html/info/docs rm -rf $INPUT rm -rf $OUTPUT mkdir -p $INPUT mkdir -p $OUTPUT +mkdir -p $DOCSPATH git clone https://github.com/iiab/iiab.wiki.git $INPUT @@ -38,12 +44,15 @@ lynx -reload -source https://github.com/XSCE/xsce/blob/release-6.2/ReleaseNotes6 lynx -reload -source https://github.com/XSCE/xsce/blob/release-6.2/ReleaseNotes6.1.md > $DESTPATH/ReleaseNotes6.1.html # Download Raspberry Pi guides -wget -nc -P $DESTPATH https://www.raspberrypi.org/magpi-issues/Beginners_Guide_v1.pdf -wget -nc -P $DESTPATH https://dn.odroid.com/IoT/other_doc.pdf +wget -nc https://www.raspberrypi.org/magpi-issues/Beginners_Guide_v1.pdf -O $DOCSPATH/Raspberry_Pi_Beginners_Guide_v1.pdf || true # Overrides set -e +wget -nc https://dn.odroid.com/IoT/other_doc.pdf -O $DOCSPATH/Raspberry_Pi_User_Guide_v4.pdf || true + +cp -p "{{ iiab_dir }}/roles/lokole/Lokole-IIAB_Users_Manual.pdf" $DOCSPATH # /opt/iiab/iiab # Update Raspberry Pi guide links on main page (http://box/info) -sed -i -r "s|https://www.raspberrypi.org/magpi-issues/Beginners_Guide_v1.pdf|Beginners_Guide_v1.pdf|g" $DESTPATH/index.html -sed -i -r "s|https://dn.odroid.com/IoT/other_doc.pdf|other_doc.pdf|g" $DESTPATH/index.html +sed -i -r "s|https://www.raspberrypi.org/magpi-issues/Beginners_Guide_v1.pdf|docs/Raspberry_Pi_Beginners_Guide_v1.pdf|g" $DESTPATH/index.html +sed -i -r "s|https://dn.odroid.com/IoT/other_doc.pdf|docs/Raspberry_Pi_User_Guide_v4.pdf|g" $DESTPATH/index.html +sed -i -r "s|https://github.com/iiab/iiab/blob/master/roles/lokole/Lokole-IIAB_Users_Manual.pdf|docs/Lokole-IIAB_Users_Manual.pdf|g" $DESTPATH/index.html # Make links refer to local items for f in $DESTPATH/*.html; do diff --git a/roles/lokole/The Lokole-IIAB User's Manual.pdf b/roles/lokole/Lokole-IIAB_Users_Manual.pdf similarity index 100% rename from roles/lokole/The Lokole-IIAB User's Manual.pdf rename to roles/lokole/Lokole-IIAB_Users_Manual.pdf diff --git a/roles/lokole/README.rst b/roles/lokole/README.rst index 6e07ecfd4..cd2267eb8 100644 --- a/roles/lokole/README.rst +++ b/roles/lokole/README.rst @@ -80,7 +80,7 @@ Lokole and Internet-in-a-Box would welcome a business plan (whether volunteer-ba Troubleshooting --------------- -For further usage information and troubleshooting, refer to the `Lokole user manual `_. +For further usage information and troubleshooting, refer to the `Lokole user manual `_. Known Issues ------------ diff --git a/roles/lokole/tasks/install.yml b/roles/lokole/tasks/install.yml index 6b7bac154..c1033b8fe 100644 --- a/roles/lokole/tasks/install.yml +++ b/roles/lokole/tasks/install.yml @@ -1,3 +1,6 @@ +# Lokole PDF (User's Guide) gets copied for offline use (http://box/info) here: +# https://github.com/iiab/iiab/blob/master/roles/httpd/templates/refresh-wiki-docs.sh#L47 + - name: "Install 7 packages for Lokole: python3, python3-pip, python3-venv, python3-dev, libffi-dev, libssl-dev, bcrypt" apt: name: