hipporion/autoanswer_line.sh
2019-10-01 19:01:56 +02:00

12 lines
290 B
Bash
Executable file

#!/bin/bash
cd "$(dirname "$0")"
line="$1"
state="$2"
{ [[ "$line" =~ ^[0-9]+$ ]] && [[ "$state" =~ ^[01]$ ]]; } || { echo >&2 "usage: $0 <line> <0|1>"; exit 1; }
. config.txt
ip_prefix=${server_ip%.*}
ip="$ip_prefix.$line"
./admin_scripts/auto_answer.pl "$ip" "$telnet_pass" 2 "$state"