OpenWRT Update v19.07.4

Today I received an rss feed about the new version of openwrt. If you use it, keep an eye on your specific device.

The following also reminds you to keep your packages up to date. The script is from (German).

Update notification for packages


opkg update && opkg install msmtp nano


nano /etc/msmtprc
# Set default values for all following accounts.
auth           on
tls            on
tls_trust_file /etc/ssl/certs/ca-certificates.crt
logfile        ~/.msmtp.log

# Your Provider
account        your-provider
port           587
password       your-password

# Set a default account
account default : your-provider

# Syslog logging with facility LOG_MAIL instead of the default LOG_USER.
syslog LOG_MAIL


nano /root/update-notification

opkg update
opkg list-upgradable > updates.txt

if [ -s updates.txt ]
        sed -i '1i To:' updates.txt
        sed -i '2i Subject: OpenWrt Updates' updates.txt
        cat updates.txt | msmtp -a default
rm updates.txt
chmod +x /root/update-notification


crontab -e
# Update list of available packages | Send notification mail
45 06 * * * /root/update-notification

If there is no crontab defined (i.e. /etc/crontabs/ is empty), then cron won't start! Make sure you already defined cron jobs before trying to start cron.

/etc/init.d/cron start
/etc/init.d/cron enable

SSH login info

nano ~/.profile

opkgInstalled="$(opkg list-installed 2> /dev/null | wc -l)" #silencing error output
opkgUpgradable="$(opkg list-upgradable 2> /dev/null | wc -l)" #silencing error output

echo "$opkgInstalled packages are installed." && echo "$opkgUpgradable packages can be upgraded." && echo
echo "Upgrade commands:"
echo "List available updates: opkg list-upgradable"
echo "Upgrade package: opkg upgrade <PACKAGE>"
echo "Upgrade all packages: opkg list-upgradable | cut -f 1 -d ' ' | xargs opkg upgrade" && echo

Leave a Reply

Your email address will not be published. Required fields are marked *