Skip to content

Instantly share code, notes, and snippets.

@mokrates
Created February 7, 2024 18:30
Show Gist options
  • Save mokrates/f3fcb3e18ace92e2620a9a7c791b519a to your computer and use it in GitHub Desktop.
Save mokrates/f3fcb3e18ace92e2620a9a7c791b519a to your computer and use it in GitHub Desktop.
cygwin update reminder

Update reminder for Cygwin

$ cat check_weekly_update.sh
#!/bin/bash

## check if the last cygwin update is less than a week back by
## checking if the newest file in /etc/setup is younger than a week

if [ $(( $(stat -c %Z /etc/setup/$(ls -tr /etc/setup | cat | tail -n 1)) + (7*24*60*60) )) -lt $(date +%s) ]; then
    echo $0: last update seems to be more than a week past. please update cygwin.
fi

and ~/.bashrc

## running interactively
## be silent if not interactive
if [[ $- == *i* ]]; then
    ~/check_weekly_update.sh
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment