I write a small bash script who check the latest stable Nextcloud server version available and notify me
I would like the script notify me with "notify-send" command only if the server version number change.
My simple script :
#!/bin/bash
# The latest stable version of Nextcloud server in a variable
LatestStableVersion=$(curl -s https://nextcloud.com/install/ | grep 'Latest stable version:' | awk '{print $18}')
# Notify latest stable version of Nextcloud server
notify-send -u critical -t 12000 "Nextcloud" "New version available : $LatestStableVersion"
I want the notification only if the server number version change in the "$LatestStableVersion" variable. I suppose with "while" loop.
Have you an idea how to do this ?
Thanks
I have test a new idea and my bash script run succesfully :
1 – I get the lastest stable version of Nextcloud server in a variable
2 – I store in separate text file the current version running on my personal server
3 – The script compare the latest version than current, notify me if they are not equal and change (in the text file) the current version with new.
A cron task execute the script every minutes.
It's complicated, I know, but it works.
Thanks