Created
May 23, 2018 11:56
-
-
Save bor/19fa18efa4b264f4447739d197b19928 to your computer and use it in GitHub Desktop.
lede_pkgs_update.sh
This file contains 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/ash | |
echo "Updating package list..." | |
opkg update > /dev/null | |
if [ `opkg list-upgradable | cut -d " " -f1 | wc -l` -gt 0 ]; then | |
echo "Available updates:" | |
opkg list-upgradable | |
echo "" | |
valid=0 | |
while [ $valid == 0 ] | |
do | |
read -n1 -s -p "Upgrade all available packages? [Y/n]" choice | |
case $choice in | |
y|Y|"" ) | |
valid=1 | |
echo "" | |
echo "Upgrading all packages..." | |
opkg list-upgradable | cut -d " " -f1 | xargs -r opkg upgrade | |
;; | |
n|N) | |
valid=1 | |
echo "" | |
echo "Upgrade cancelled" | |
;; | |
*) | |
echo "" | |
echo "Unknown input" | |
;; | |
esac | |
done | |
else | |
echo "No updates available" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment