3 if [ $# -lt 1 ]; then tomenu
=0; fi
14 if [ "$(echo $*|grep debug)" != "" ] ||
[ ! -z $4 ]; then dbg
=0; fi
16 if [ -f $pwf ]; then pas
=$
(cat $pwf); fi
17 if [ "$(echo $srv|grep ':')" != "" ]; then
18 prt
=$
(echo $srv|cut
-d ':' -f2)
19 srv
=$
(echo $srv|cut
-d ':' -f1)
22 if [ -x $
(which nc
) ]; then return 0; fi
23 nc
-zu $1 $2 && return 0;
27 mt
=$mtpath/bin
/minetest
30 if [ "$1" = "menu" ]; then mmt
=$mt
31 else mmt
="$mt --go --address $srv --port $prt --name $usr --password $passwd"; fi
32 $mmt 2>&1|
while read k
; do
33 l
=$
(echo $k|
sed "s,\x1B\[[0-9;]*[a-zA-Z],_,g")
34 if [ "$(echo $l |grep '\[cchat\]\|\[hignore\]')" != "" ]; then
35 srvstr
=$
(echo $l|cut
-d ' ' -f 5)
36 lgstr
=$
(echo $l|
sed 's/ACTION\[Main\]://'|
sed "s/ \[cchat\] //;s/$srvstr//")
37 if [ "$(echo $l |grep '\[sent\]')" != "" ]; then continue; fi
38 echo $lgstr >> $chatlogdir/$srvstr.txt
40 echo $l >> $logfile 2>&1;
41 if [ "$(echo $l|grep 'AUTOMT exit to menu')" != "" ]; then
43 touch /tmp
/$
(whoami
)-wsxmen
46 if [ "$(echo $l|grep 'AUTOMT Actually Quit')" != "" ]; then
48 touch /tmp
/$
(whoami
)-wsxt
52 if [ $dbg -eq 0 ]; then echo $l; fi
55 if [ $tomenu -eq 0 ]; then
59 if [ -f /tmp
/$
(whoami
)-wsxt ]; then
60 rm -f /tmp
/$
(whoami
)-wsxt
63 if [ -f /tmp
/$
(whoami
)-wsxmen ]; then
64 rm -f /tmp
/$
(whoami
)-wsxmen
69 if check_host
$srv $prt; then
70 if ! ps
$mtpid >/dev
/null
2>&1 && [ ! -f /tmp
/$
(whoami
)-wsxmen ] && [ ! -f /tmp
/$
(whoami
)-wsxt ]; then startmt
& fi
76 rm -f /tmp
/$
(whoami
)-wsxt
77 rm -f /tmp
/$
(whoami
)-wsmen