3 if [ $# -lt 1 ]; then tomenu
=0; fi
14 rm -f /tmp
/$
(whoami
)-wsxt
15 rm -f /tmp
/$
(whoami
)-wsmen
16 if [ "$(echo $*|grep debug)" != "" ] ||
[ ! -z $4 ]; then dbg
=0; fi
18 if [ -f $pwf ]; then pas
=$
(cat $pwf); fi
19 if [ "$(echo $srv|grep ':')" != "" ]; then
20 prt
=$
(echo $srv|cut
-d ':' -f2)
21 srv
=$
(echo $srv|cut
-d ':' -f1)
24 if [ -x $
(which nc
) ]; then return 0; fi
25 nc
-zu $1 $2 && return 0;
29 mt
=$mtpath/bin
/minetest
32 if [ "$1" = "menu" ]; then mmt
=$mt
33 else mmt
="$mt --go --address $srv --port $prt --name $usr --password $passwd"; fi
34 $mmt 2>&1|
while read k
; do
35 l
=$
(echo $k|
sed "s,\x1B\[[0-9;]*[a-zA-Z],_,g")
36 if [ "$(echo $l |grep '\[cchat\]\|\[hignore\]')" != "" ]; then
37 srvstr
=$
(echo $l|cut
-d ' ' -f 5)
38 lgstr
=$
(echo $l|
sed 's/ACTION\[Main\]://'|
sed "s/ \[cchat\] //;s/$srvstr//")
39 if [ "$(echo $l |grep '\[sent\]')" != "" ]; then continue; fi
40 echo $lgstr >> $chatlogdir/$srvstr.txt
42 echo $l >> $logfile 2>&1;
43 if [ "$(echo $l|grep 'AUTOMT exit to menu')" != "" ]; then
45 touch /tmp
/$
(whoami
)-wsxmen
48 if [ "$(echo $l|grep 'AUTOMT Actually Quit')" != "" ]; then
50 touch /tmp
/$
(whoami
)-wsxt
54 if [ $dbg -eq 0 ]; then echo $l; fi
57 if [ $tomenu -eq 0 ]; then
61 if [ -f /tmp
/$
(whoami
)-wsxt ]; then
62 rm -f /tmp
/$
(whoami
)-wsxt
65 if [ -f /tmp
/$
(whoami
)-wsxmen ]; then
66 rm -f /tmp
/$
(whoami
)-wsxmen
71 if check_host
$srv $prt; then
72 if ! ps
$mtpid >/dev
/null
2>&1 && [ ! -f /tmp
/$
(whoami
)-wsxmen ] && [ ! -f /tmp
/$
(whoami
)-wsxt ]; then startmt
& fi
78 rm -f /tmp
/$
(whoami
)-wsxt
79 rm -f /tmp
/$
(whoami
)-wsmen