Dateien hochladen nach „“
Dieses Script muss ausführbar in /root/bin auf OpenWRT-Router hinterlegt sein.
This commit is contained in:
parent
313a8bbf52
commit
7b457ea9cc
1 changed files with 20 additions and 0 deletions
20
update-openwrt_opkg-packages.sh
Normal file
20
update-openwrt_opkg-packages.sh
Normal 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
|
||||
|
Loading…
Reference in a new issue