I have a script that is supposed to run whenever any user logs in whether in GUI or CLI.
Code:
#! /bin/bash
# Voice synth'ed welcome script
## If earlier than 05:30
if [ "$(date '+%H%M')" -lt 0530 ]; then
espeak -s 140 -ven-us+f4 "Why are you up this early $USER ?"
fi
## If bewteen 05:30 and 12:00
if [ "$(date '+%H%M')" -gt 0530 -a $(date "+%H%M") -lt 1200 ]; then
espeak -s 140 -ven-us+f4 "Good morning, $USER"
fi
## If between 12:00 and 21:30
if [ "$(date '+%H%M')" -gt 1200 -a "$(date '+%H%M')" -lt 2130 ]; then
espeak -s 140 -ven-us+f4 "Good afternoon, $USER"
fi
## If later than 21:30
if [ "$(date '+%H%M')" -gt 2130 ]; then
espeak -s 140 -ven-us+f4 "Hello $USER, are you sure you should be logging in at this time?"
fi
Where would I put it/what would I change to make it run whenever any user logged in wether in GUI or CLI?
I have two machines on xubuntu and one kubuntu that I would like to do this one is the process the same on both?
As always thanks in advance
--Djyou