cat actions_getwho.conf [update]command:/home/mts/cron_scripts/getWho.shparameters:type:scriptdescription: Check for logged in users message:get who is logged in.
service configd restartconfigctl getwho update
#!/usr/local/bin/bashbaseDir="/home/mts/cron_scripts/"errFile="/tmp/users.err"cronFile="/tmp/getWho.cron"users=$(/usr/bin/who -a)if [ ${#users} -gt 0 ]; then ${baseDir}discordPush.sh "ALARM: ${users} logged on" touch ${errFile}else if [ -f ${errFile} ]; then ${baseDir}discordPush.sh "OK: Users have logged off" rm ${errFile} fifiecho "OK" > ${cronFile}echo 0
# Origin/Description: cron/Checking for logged in users2 * * * * /usr/local/sbin/configctl getwho update