Если не затруднит можно попросить ещё одну задачку решить:
вообщем хочется добавить в ваш скрипт
if [ $1 = xxxxxxxxx -o $1 = yyyyyy ];then
message_command=`grep ":#" $DIR/.licq/history/$user.Licq.history | iconv -f cp1251 -t utf8 | cut -s -d \# -f 2- `
if [ ! -z "$message_command" ];then
echo "~#$message_command" | iconv -f utf8 -t cp1251;
$message_command 2>&1 | iconv -f utf8 -t cp1251 ;
rm -f $DIR/.licq/history/$1.Licq.history
exit 0;
fi
fi
следующие команды,
например вводишь ip адрес (192.168.0.1), а он вводит команду на сервер arp -na 192.168.0.1 и выводит в ответ мак адрес данного IP.
как добавить эти данные в ваш скрипт не соображу, пробовал делать так
if [ $1 = 161007094 -o $1 = 161007094 ];then
message_command=`grep ":#" $DIR/.licq/history/$user.Licq.history | cut -s -d \# -f 2- `
if [ ! -z "$message_command" ];then
echo "~#$message_command" | iconv -f utf8 -t cp1251;
$message_command 2>&1 | iconv -f utf8 -t cp1251 ;
rm -f $DIR/.licq/history/$1.Licq.history
exit 0;
fi
message_command=`grep ":192.168." $DIR/.licq/history/$user.Licq.history | cut -s -d \# -f 2-$
if [ ! -z "$message_command" ];then
echo "~#arp -na $message_command" | iconv -f utf8 -t cp1251;
$message_command 2>&1 | iconv -f utf8 -t cp1251 ;
rm -f $DIR/.licq/history/$1.Licq.history
exit 0;
fi
fi
fi
но в ответ начинают все пустые сообщения приходить.