File tree Expand file tree Collapse file tree 5 files changed +9
-9
lines changed Expand file tree Collapse file tree 5 files changed +9
-9
lines changed Original file line number Diff line number Diff line change 33# Skip on weekends
44exit if Time . now . saturday? || Time . now . sunday?
55
6- # Exit early if no sessions with my_username are found
7- exit if `who` [ /my_username/ ] . nil?
6+ # Exit early if no sessions with my username are found
7+ exit unless `who -q` . include? ENV [ 'USER' ]
88
99require 'net/telnet'
1010
Original file line number Diff line number Diff line change 1010
1111LOG_FILE = File . open ( log_file_name , 'a+' )
1212
13- # Exit early if sessions with my_username are found
14- exit unless `who` [ /my_username/ ] . nil?
13+ # Exit early if sessions with my username are found
14+ exit if `who -q` . include? ENV [ 'USER' ]
1515
1616require 'dotenv'
1717require 'twilio-ruby'
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ if [ "$DAYOFWEEK" -eq 6 ] || [ "$DAYOFWEEK" -eq 7 ]; then
77 exit
88fi
99
10- # Exit early if any session with my_username is found
10+ # Exit early if any session with my username is found
1111if who | grep -wq $USER ; then
1212 exit
1313fi
Original file line number Diff line number Diff line change @@ -7,8 +7,8 @@ if [ "$DAYOFWEEK" -eq 6 ] || [ "$DAYOFWEEK" -eq 7 ]; then
77 exit
88fi
99
10- # Exit early if no sessions with my_username are found
11- if ! who | grep -wq ' my_username ' ; then
10+ # Exit early if no sessions with my username are found
11+ if ! who | grep -wq $USER ; then
1212 exit
1313fi
1414
Original file line number Diff line number Diff line change 1010
1111LOG_FILE = File . open ( log_file_name , 'a+' )
1212
13- # Exit early if no sessions with my_username are found
14- exit if `who` [ /my_username/ ] . nil?
13+ # Exit early if no sessions with my username are found
14+ exit if `who -q` . include? ENV [ 'USER' ]
1515
1616require 'dotenv'
1717require 'twilio-ruby'
You can’t perform that action at this time.
0 commit comments