- Add comprehensive wiki documentation under .github/wiki/ (19 articles) - Add READMEs to directories that lacked them - Fix merge conflict markers in existing READMEs - Update root readme.md with improved structure Co-authored-by: Jarvis <jarvis@wickedyoda.local>
3.3 KiB
Core Scripts
This wiki documents the main automation scripts in the repository root.
update-from_repo.sh
Bash script to clone/update the public-setupfiles repository.
Location: Repository root
Usage:
sudo ./update-from_repo.sh
What it does:
- Auto-installs Git if not present (Debian/Ubuntu/OpenWrt)
- Clones
https://github.com/wickedyoda/public-setupfiles.git - Sets executable permissions on all files
- Supports re-running to update existing clones
Options: None (simple script)
update-from_repo.py
Python version of the repository sync script.
Location: Repository root
Usage:
python3 update-from_repo.py
Dependencies: None (uses only stdlib)
What it does:
- Same functionality as the shell script
- Installs Python 3 via apt if missing
- Uses subprocess to run git commands
setup_cron_clean.sh
Installs automatic system updates as a system cron job.
Location: Repository root
Usage:
sudo ./setup_cron_clean.sh
What it does:
- Installs cron package
- Copies
updates_clean.shto/usr/local/sbin/ - Creates
/etc/cron.d/auto_updates - Schedules updates every 6 hours
Cron Schedule:
| Task | Schedule | Command |
|---|---|---|
| System updates | 0 */6 * * * |
/usr/local/sbin/updates_clean.sh |
| Mount verification | 5 */1 * * * |
mount -a |
Log file: /var/log/auto_updates.log
MAILTO: Commented out by default. Uncomment and set your email if you want update notifications.
updates_clean.sh
The actual update script called by cron.
Location: Repository root (also copy at /usr/local/sbin/updates_clean.sh)
Run manually:
sudo ./updates_clean.sh
What it does:
apt update— Refresh package listsapt full-upgrade -y— Apply all updatesapt autoremove -y— Remove orphaned packagesapt autopurge -y— Purge config of removed packages (Debian 11+)apt clean -y— Clear local cache
Logging: All output goes to stdout and /var/log/auto_updates.log
collect_info.sh
System information collection script.
Location: Repository root
Usage:
./collect_info.sh
Output: Creates info.txt with system details including:
- OS distribution and version
- Hostname and kernel
- CPU, memory, storage
- GPU and PCI/USB devices
- Network interfaces and routes
- Display configuration
gather-logs/gather_logs.sh
Collects system logs for troubleshooting.
Location: gather-logs/
Usage:
./gather-logs.sh
Generates: /tmp/{date}-{hostname}.zip containing:
/var/log/— syslog, auth, kern, daemon, dmesg, dpkg, aptjournalctl— current boot and all logs- System info — hostname, uname, df, free, ip addr, systemctl failed
Comparison: Shell vs Python Update Scripts
| Feature | update-from_repo.sh |
update-from_repo.py |
|---|---|---|
| Language | Bash | Python |
| Git install | apt/opkg | apt only |
| Path typo | N/A | pubic-setupfiles (bug) |
| Permissions | 755 recursive | 777 recursive |
| Error handling | Basic | Try/except |
Note: The Python script has a typo in the clone path (pubic-setupfiles instead of public-setupfiles). Prefer the shell script for now.