File tree 5 files changed +9
-9
lines changed
5 files changed +9
-9
lines changed Original file line number Diff line number Diff line change 3
3
# Skip on weekends
4
4
exit if Time . now . saturday? || Time . now . sunday?
5
5
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' ]
8
8
9
9
require 'net/telnet'
10
10
Original file line number Diff line number Diff line change 10
10
11
11
LOG_FILE = File . open ( log_file_name , 'a+' )
12
12
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' ]
15
15
16
16
require 'dotenv'
17
17
require 'twilio-ruby'
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ if [ "$DAYOFWEEK" -eq 6 ] || [ "$DAYOFWEEK" -eq 7 ]; then
7
7
exit
8
8
fi
9
9
10
- # Exit early if any session with my_username is found
10
+ # Exit early if any session with my username is found
11
11
if who | grep -wq $USER ; then
12
12
exit
13
13
fi
Original file line number Diff line number Diff line change @@ -7,8 +7,8 @@ if [ "$DAYOFWEEK" -eq 6 ] || [ "$DAYOFWEEK" -eq 7 ]; then
7
7
exit
8
8
fi
9
9
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
12
12
exit
13
13
fi
14
14
Original file line number Diff line number Diff line change 10
10
11
11
LOG_FILE = File . open ( log_file_name , 'a+' )
12
12
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' ]
15
15
16
16
require 'dotenv'
17
17
require 'twilio-ruby'
You can’t perform that action at this time.
0 commit comments