Dateien hochladen nach „“

Dieses Script muss ausführbar in /root/bin auf OpenWRT-Router hinterlegt sein.
This commit is contained in:
dw-loewe 2022-12-16 14:24:28 +00:00
parent 313a8bbf52
commit 7b457ea9cc

View file

@ -0,0 +1,20 @@
#!/bin/ash
# script written by David Weber <mail@dw-loewe.de>
opkg update
# find out, if there are any upgradable packages
#UPGRADABLECNT=$(opkg list-upgradable | cut -f 1 -d ' ' | wc -l )
opkg list-upgradable | cut -f 1 -d ' ' > upgradable-packages.list
UPGRADABLECNT=`wc -l upgradable-packages.list | awk '{ print $1 }'`
if [ ${UPGRADABLECNT} -eq 0 ]; then
echo "no updates; exiting"
exit 1
else
echo "available updates: ${UPGRADABLECNT}"
cat upgradable-packages.list | xargs opkg upgrade
# cat upgradable-packages.list | xargs opkg --download-only
# cat upgradable-packages.list | xargs opkg upgrade --cache
fi