Append this to your .zshrc to apply updates:

### updates
TIMESTAMP_FILE="/tmp/update.timestamp"
if [ ! -e "$TIMESTAMP_FILE" ] ; then
    # creates the file with a date way in the past
    touch --date=2020-01-01 "$TIMESTAMP_FILE"
fi

# if the timestamp file is older than 3600 seconds ago
if find "$TIMESTAMP_FILE" -mmin -3600 ; then
    echo "*******************"
    echo "** Let's Update! **"
    echo "*******************"
    # updates the time to now
    touch "$TIMESTAMP_FILE"
    /home/johnk/bin/update.sh
    sshk "sh update-wp.sh"
fi
Code language: PHP (php)

I prefer to update from the command line, because it’s less intrusive to me.

This script runs when the Terminal opens a shell. That’s why I check that it’s already run within the past day.

The update.sh script runs apt upgrade, and then flatpak update.

The ssh command runs an update script for wordpress, up on the server.

admin
Author: admin

This is the server’s system administrator. This site is undergoing some changes.