Way to notify admin of pending updates?

Hello,

I was wondering if their is a way for IPFire to notify the admin when there are updates to install? The last few years I’ve been just having to remember to check the IPFire web site once in a while or login to the router web interface to check, so sometimes I’m late getting the updates installed. I’m guessing sending an e-mail would be the simplest, but I’m open to other ways if there are some. I’ve browsed some of the system monitoring e-mail add-ons and found this to be the closest:

https://wiki.ipfire.org/optimization/scripts/sysinfo

But I don’t know enough to know if it has the capability to let me know when an update is needed for IPFire.

Any suggestions or ideas?

Thanks!

you are a mebmer of this forum (and people), don’t you get an email when a new core is released?

I do not as I did not want any e-mails beyond forum threads I’ve subscribed to. Is this the standard way people get notified of IPFire updates?

I cannot say if is “the standard way” but I provided my email address when I logged on to this forum so I get emails about upcoming releases.

Yes, when you log in to https://people.ipfire.org, you will be asked to sign up for notifications about it. As soon as an update is available, we will send you a message.

Michael,

Ok, I can accept this. It does though seem to me that there needs to be an alternate way, independent of this web site, and within IPFire itself, to notify the admin of updates to install. I’m not sure all users feel the need to participate or sign up here in the IPFire community. Would you consider this as a feature request?

Yes, I would consider this as a feature request. However I am currently very short on time, so won’t have any chance to implement this.

But patches are of course welcome.

Some time ago i wrote a little python script to evaluate the output of pakfire status and send a message to my discord channel. The script is started every day at 12:00 by cron.
Perhaps someone could replace the last two lines with code to send an email.

import requests
import subprocess

# Discord-Kanal webhook
webhook = "https://discordapp.com/api/webhooks/<webhooknummer>"

# Pakfire Status einlesen
subprocess.call("/usr/local/bin/pakfire update", shell=True)
page=str(subprocess.Popen("/usr/local/bin/pakfire status", shell=True, stdout=subprocess.PIPE).stdout.read())

# Pakfire Status auswerten
# Core Updates
coreindex = page.find("Core-Update available:") + 23
coreend = page.find("\\n", coreindex)
# Paket Updates
packageindex = page.find("Package-Updates available:") + 27
packageend = page.find("\\n", packageindex)
packagecnt = page[packageindex:packageend]
# Neustart erforderlich
rebootindex = page.find("Reboot required:") + 17
rebootend = page.find("\\n", rebootindex)

# Meldung erzeugen
meldung=""
if page[coreindex:coreend] != "no":
    meldung += "Core-Update verfügbar\n"
if packagecnt != "0":
    meldung += packagecnt + " Paket-Update" + ("" if (packagecnt == "1") else "s") + " verfügbar\n"
if page[rebootindex:rebootend] != "no":
    meldung += "Neustart erforderlich\n"

# Meldung an Discord-Kanal senden
if meldung:
    payload = {'username': 'IPFire', 'content': meldung}
    requests.post(webhook, data=payload)
2 Likes

I submitted a series of patches last year which would, among other things, be capable of sending an email for this (statusmail). Unfortunately it landed at a time when the developers were particularly busy with infrastructure changes etc.

I’ve made some minor changes to simplify code etc, and when I’ve finished the IP Address Blacklist I’ll try re-submitting it.

3 Likes