Skip to content

Commit e031c73

Browse files
committed
use USER env variable
issue NARKOZ#13
1 parent a4c4c5e commit e031c73

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

fucking_coffee.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
# Skip on weekends
44
exit 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

99
require 'net/telnet'
1010

hangover.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010

1111
LOG_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

1616
require 'dotenv'
1717
require 'twilio-ruby'

hangover.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ if [ "$DAYOFWEEK" -eq 6 ] || [ "$DAYOFWEEK" -eq 7 ]; then
77
exit
88
fi
99

10-
# Exit early if any session with my_username is found
10+
# Exit early if any session with my username is found
1111
if who | grep -wq $USER; then
1212
exit
1313
fi

smack-my-bitch-up.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ if [ "$DAYOFWEEK" -eq 6 ] || [ "$DAYOFWEEK" -eq 7 ]; then
77
exit
88
fi
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
1313
fi
1414

smack_my_bitch_up.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010

1111
LOG_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

1616
require 'dotenv'
1717
require 'twilio-ruby'

0 commit comments

Comments
 (0)