Files
bin/manage_teams

32 lines
505 B
Bash
Executable File

#!/bin/bash
log=/tmp/manage_teams.log
debug=1
hour=`date +%H`
dow=`date +%u`
if [ $dow -gt 5 ]; then
kill=1
echo "dow($dow): $kill"
elif [ $hour -gt 18 ]; then
kill=1
echo "hour($hour): $kill"
elif [ $hour -lt 7 ]; then
kill=1
echo "hour($hour): $kill"
else
kill=0
fi
if [ $debug ]; then
echo "`date`: if dow=$dow (>5?) or hour=$hour (<7 or >18?) -> kill=$kill (1==will kill)" >> $log
fi
if [ $kill == 1 ]; then
if [ $debug ]; then
echo "`date`: killed teams" >> $log
fi
pkill -9 teams
fi