Closed cmonty14 closed 2 years ago
For interested people here's a working solution:
root@eddie:~# crontab -l
@daily /usr/sbin/opkg-upgrade -u && touch /tmp/opkg-upgrade-check || rm -f /tmp/opkg-upgrade-check
/root/.profile:
upgradeCheckFile='/tmp/opkg-upgrade-check'
YELLOW='\033[1;33m'
GREEN='\033[0;32m'
NC='\033[0m' # No Color
echo "Software status report:"
if [ -f $upgradeCheckFile ];
then
echo -e "${YELLOW}--> Upgrades are available.${NC}\n----> List available upgrades: opkg-upgrade -l\n----> Upgrade packages: opkg-upgrade\n"
else
echo -e "${GREEN}--> No upgrades available.${NC}\n"
fi
The delay is probably because it is fetching the lists (opkg update
).
Usually the lists reside into a temporary folder. You would probably need to change it to a permanent folder (can be done if you have a pendrive into the router) and also run opkg update
from cron regularly. Then you can run opkg-upgrade with the -n
flag for it to skip the opkg update
part. It will just use the current available lists without getting new ones.
Note: I am not sure, but if you run with -n
without lists available (just rebooted and still using the temp folder) - you will get an error on execution. This could be remedied by also adding an opkg-update
to the boot sequence.
Hello, I have integrated
opkg-upgrade
in .profile, means I get this when starting a shell-session as root:This is implemented with the following coding in .profile:
The downside of this implementation is that I have to wait several seconds until the command prompt is ready.
Question: Can I check for new packages in the background (regularely) and then fetch the results only w/o waiting for command
opkg-upgrade -u
to return data?THX