Skip to content

Commit

Permalink
use USER env variable
Browse files Browse the repository at this point in the history
issue NARKOZ#13
  • Loading branch information
NARKOZ committed Nov 23, 2015
1 parent a4c4c5e commit e031c73
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions fucking_coffee.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# Skip on weekends
exit if Time.now.saturday? || Time.now.sunday?

# Exit early if no sessions with my_username are found
exit if `who`[/my_username/].nil?
# Exit early if no sessions with my username are found
exit unless `who -q`.include? ENV['USER']

require 'net/telnet'

Expand Down
4 changes: 2 additions & 2 deletions hangover.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

LOG_FILE = File.open(log_file_name, 'a+')

# Exit early if sessions with my_username are found
exit unless `who`[/my_username/].nil?
# Exit early if sessions with my username are found
exit if `who -q`.include? ENV['USER']

require 'dotenv'
require 'twilio-ruby'
Expand Down
2 changes: 1 addition & 1 deletion hangover.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ if [ "$DAYOFWEEK" -eq 6 ] || [ "$DAYOFWEEK" -eq 7 ]; then
exit
fi

# Exit early if any session with my_username is found
# Exit early if any session with my username is found
if who | grep -wq $USER; then
exit
fi
Expand Down
4 changes: 2 additions & 2 deletions smack-my-bitch-up.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ if [ "$DAYOFWEEK" -eq 6 ] || [ "$DAYOFWEEK" -eq 7 ]; then
exit
fi

# Exit early if no sessions with my_username are found
if ! who | grep -wq 'my_username'; then
# Exit early if no sessions with my username are found
if ! who | grep -wq $USER; then
exit
fi

Expand Down
4 changes: 2 additions & 2 deletions smack_my_bitch_up.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

LOG_FILE = File.open(log_file_name, 'a+')

# Exit early if no sessions with my_username are found
exit if `who`[/my_username/].nil?
# Exit early if no sessions with my username are found
exit if `who -q`.include? ENV['USER']

require 'dotenv'
require 'twilio-ruby'
Expand Down

0 comments on commit e031c73

Please sign in to comment.