-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmessagebored
More file actions
85 lines (60 loc) · 2.19 KB
/
messagebored
File metadata and controls
85 lines (60 loc) · 2.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#!/bin/bash
RED="tput setaf 6"
NC="tput sgr0"
c_path="/home/dvs/jschlich/script"
chat="xyü0p"
hpath=$HOME
upath="$hpath/bin"
clear
while getopts "hc:" opt
do
case $opt in
h) echo "
$($RED)
███ ███ ███████ ███████ ███████ █████ ██████ ███████ ██████ ██████ ██████ ███████ ██████
████ ████ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
██ ████ ██ █████ ███████ ███████ ███████ ██ ███ █████ ██████ ██ ██ ██████ █████ ██ ██
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
██ ██ ███████ ███████ ███████ ██ ██ ██████ ███████ ██████ ██████ ██ ██ ███████ ██████
$($NC)
(I was bored so you can chat)
to exit use EXIT in all caps (or the deamon will run till exited propperly idc)
Inside the chat just type your message.
-c chatname
----"
exit;;
c) chat=$OPTARG;;
esac
done
if [ $chat = "xyü0p" ]
then
$c_path/messagebored -h
exit
else
$c_path/messagebored -h
fi
user=$(echo "$hpath" | cut -d"/" -f 4)
ln -s -f "$c_path/../bin/chatnot" "$upath/chatnot" > "$c_path/.tmperr"
is_pid=$(ps aux | grep "chatnot"| grep "pts/" | grep -v "grep" | cut -d"/" -f 1 | grep "$user")
echo $is_pid
if [ -z "$is_pid" ]
then
"$c_path/chatnot" "$chat" &
imp_pid=$!
RED="tput setaf 1"
echo "$($RED)started deamon for $chat $($NC)"
else
imp_pid=$(echo "$is_pid" | cut -d"." -f 1 | cut -c 9-16)
fi
while true
do
sleep 1
read -r line
if [ "$line" = "EXIT" ]
then
kill "$imp_pid"
clear
exit
fi
$c_path/msg -c "$chat" -m "$line"
done