Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Finish fucking-coffee.sh #151

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 27 additions & 3 deletions fucking-coffee.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,30 @@
#!/bin/sh
#
# Requires fucking_coffee script in your bin
#

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

host=123.123.123.123
user=ass
passwd=ass
fifo=~/.fuck

[ -p "$fifo" ] || { rm -f $fifo; mkfifo $fifo; }
exec 5<>$fifo # open $fifo for both reading and writing on fd 5

telnet $host -l $user <&5 &

sleep 16

echo $passwd > $fifo
sleep 1
echo 'sys brew' > $fifo

sleep 24

echo 'sys pour' > $fifo
sleep 1
# telnet escape character ^] ascii is \035
echo -e "\035quit" > $fifo