Last active
January 2, 2025 06:42
-
-
Save franklinmoy3/84f69b896a0f95626ec270bfb3487f1d to your computer and use it in GitHub Desktop.
OpenWRT restore installed packages
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Assumes backup was made using sysupgrade -k -b <name> | |
# Paste package list into /etc/backup/installed_packages.txt | |
# Reinstalls packages (ignoring source descriptors "overlay" and "rom" using awk) | |
opkg update | |
cat /etc/backup/installed_packages.txt | awk 'gsub(/overlay|rom/, ""){print}' | xargs opkg install | |
# Clean up duplicate conffiles generated by OPKG | |
rm /etc/*/*-opkg | |
echo "Done. Any duplicate conffiles created by OPKG have been deleted" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment