What type of hardware are you using: VPS bought online What YunoHost version are you running: 12.0.17 How are you able to access your server: The webadmin
Describe your issue
I’d like to have an option to send an email to the administrator when an update is available in the YunoHost update section. This could probably be achieved with a script and a cron job.
I posted in this section because I can’t open a thread in “discuss”.
#!/bin/bash
# Configura la tua email qui:
EMAIL_DEST="your@email.com
# File temporaneo per memorizzare i risultati
TMP_FILE=$(mktemp)
# Controlla aggiornamenti di sistema
echo "=== Aggiornamenti di sistema ===" > "$TMP_FILE"
sudo yunohost tools upgrade system >> "$TMP_FILE" 2>&1
# Controlla aggiornamenti delle app
echo -e "\n=== Aggiornamenti delle app ===" >> "$TMP_FILE"
sudo yunohost app upgrade app >> "$TMP_FILE" 2>&1
# Se il file contiene qualcosa di diverso da 'Nothing to upgrade'
if ! grep -q "Nothing to upgrade" "$TMP_FILE"; then
mail -s "Aggiornamenti disponibili su $(hostname)" "$EMAIL_DEST" < "$TMP_FILE"
fi
# Rimuove il file temporaneo
rm "$TMP_FILE"
I tried making this script but I don’t know if the “sudo yunohost tools upgrade system” command does the installation and/or if there is a way to just do a check without doing the installation.
Thank you!
Yes this is the app to look for in case you need to be warned about debian package updates, as well as automated updates for all or security-only updates.
It does not handle Yunohost app however.
Only could maybe enhance it with something like the scripts quoted here, to add Yunohost updates to the list ?