diff --git a/scripts/install-offline-lib.json b/scripts/install-offline-lib.json new file mode 100644 index 0000000..da9c26a --- /dev/null +++ b/scripts/install-offline-lib.json @@ -0,0 +1,22 @@ +[ + { + "url": "https://www.arrl.org/files/file/Regulatory/Band%20Chart/Hambands4_Color_11x8_5.pdf", + "file": "Hambands4_Color_11x8_5.pdf", + "dir": "bands/ham-radio" + }, + { + "url": "https://amrron.com/wp-content/uploads/2019/03/AmRRON-Intelligence-Brief-White-Paper.pdf", + "file": "AmRRON-Intelligence-Brief-White-Paper.pdf", + "dir": "nets/amrron" + }, + { + "url": "https://raw.githubusercontent.com/s2underground/GhostNet/1a2d08d579813e54967af06f1a871e7fa0ce583f/GhostNet_Version_1.5.pdf", + "file": "GhostNet_Version_1.5.pdf", + "dir": "nets/ghostnet" + }, + { + "url": "https://www.swpc.noaa.gov/sites/default/files/images/NOAAscales.pdf", + "file": "NOAAscales.pdf", + "dir": "space-weather" + } +] diff --git a/scripts/install-offline-lib.sh b/scripts/install-offline-lib.sh new file mode 100755 index 0000000..16d1529 --- /dev/null +++ b/scripts/install-offline-lib.sh @@ -0,0 +1,31 @@ +#!/bin/bash +# Author : Gaston Gonzalez +# Date : 14 March 2026 +# Purpose : Installs a variety of offline resources + +. ./env.sh +. ../overlay/opt/emcomm-tools/bin/et-common + +et-log "Installing offline docs..." + +OFFLINE_FILES_JSON="install-offline-lib.json" +OFFLINE_SAVE_DIR="/etc/skel/Desktop/offline" + +[[ ! -e "${OFFLINE_SAVE_DIR}" ]] && mkdir -v -p ${OFFLINE_SAVE_DIR} + +jq -c '.[]' "${OFFLINE_FILES_JSON}" | while read -r item; do + URL=$(echo "$item" | jq -r '.url') + FILE=$(echo "$item" | jq -r '.file') + DIR=$(echo "$item" | jq -r '.dir') + ABS_DIR="${OFFLINE_SAVE_DIR}/${DIR}" + + # 1. Create missing directories + mkdir -v -p "${ABS_DIR}" + + # 2. Download resources + download_with_retries ${URL} ${FILE} + + # 3. Move to offline folder + mv "${FILE}" "${ABS_DIR}/" +done + diff --git a/scripts/install.sh b/scripts/install.sh index 4650def..9c3fee2 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -2,7 +2,7 @@ # # Author : Gaston Gonzalez # Date : 16 March 2024 -# Updated : 6 March 2026 +# Updated : 14 March 2026 # Purpose : Main installer for EmComm Tools Community (ETC) . ./env.sh @@ -102,3 +102,6 @@ exitIfNotRoot # Install security tools ./install-gpa.sh + +# Install offline resources +./install-offline-lib.sh