diff --git a/overlay/etc/skel/notes/OFFLINE_SITES.md b/overlay/etc/skel/notes/OFFLINE_SITES.md new file mode 100644 index 0000000..93fbb0c --- /dev/null +++ b/overlay/etc/skel/notes/OFFLINE_SITES.md @@ -0,0 +1,24 @@ +# Offline Site Recommendations + +This is a list of online resources that I personally store locally +for offline browsing. This list will grow over time. + +Run `et-mirror.sh ` to mirror the site. For example: + +``` +et-mirror.sh https://choisser.com/packet/` +``` + +The above command will mirror the start URL https://choisser.com/packet/ +along with any pages within the site that it links to. + +The mirrored site will be available in your home directory under the +`offline-www` directory. You can open the files using the Min web browser. + + +## Packet Radio + +* https://choisser.com/packet/ +* https://www.cantab.net/users/john.wiseman/Documents/ +* https://soundcardpacket.org/ +* https://tldp.org/HOWTO/AX25-HOWTO/index.html diff --git a/overlay/opt/emcomm-tools/bin/et-mirror.sh b/overlay/opt/emcomm-tools/bin/et-mirror.sh new file mode 100755 index 0000000..25016ec --- /dev/null +++ b/overlay/opt/emcomm-tools/bin/et-mirror.sh @@ -0,0 +1,46 @@ +#!/bin/bash +# Author : Gaston Gonzalez +# Date : 29 December 2024 +# Purpose : Mirrors a website for offline browsing + +ET_OFFLINE_WWW_DIR="${HOME}/offline-www" + +if [ $# -ne 1 ]; then + echo "$(basename $) Usage: $0 " + exit 1 +fi + +if [ ! -e ${ET_OFFLINE_WWW_DIR} ]; then + et-log "Creating offline web directory: ${ET_OFFLINE_WWW_DIR}" + mkdir -v ${ET_OFFLINE_WWW_DIR} +fi + +START_URL=$1 + +# Validate the URL format +if ! [[ $START_URL =~ ^https?:// ]]; then + echo "Invalid URL. Provide a valid URL that starts with http:// or https://" + exit 1 +fi + +DOMAIN_NAME=$(echo "$START_URL" | awk -F[/:] '{print $4}') + +echo "Starting website mirroring..." + +wget --mirror \ + --convert-links \ + --adjust-extension \ + --page-requisites \ + --no-parent \ + --directory-prefix="${ET_OFFLINE_WWW_DIR}" \ + "${START_URL}" + +if [ $? -eq 0 ]; then + echo "Website mirroring completed successfully." + echo "Domain: ${DOMAIN_NAME}" + echo "URL: ${START_URL}" + echo "Output Directory: ${ET_OFFLINE_WWW_DIR}" +else + echo "An error occurred while mirroring the website." + exit 1 +fi