1
0
This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
Files
2024-07-22 01:58:46 -03:00

42 lines
1.2 KiB
Bash
Executable File

#!/bin/sh
echo -e "Content-Type: text/html \n"
node_name="WebCustom_Entry"
attr_name="querystring"
querystring=`/userfs/bin/tcapi get $node_name $attr_name`
if [ "$querystring" != "" ]
then
node_name="Account_Entry0"
attr_name="username"
username_s=`/userfs/bin/tcapi get $node_name $attr_name`
attr_name="web_passwd"
passwd_s=`/userfs/bin/tcapi get $node_name $attr_name`
username=`echo $querystring | cut -d \& -f 1`
passwd=`echo $querystring | cut -d \& -f 2`
sn=`echo $querystring | cut -d \& -f 3`
username=`echo $username | cut -d = -f 2`
passwd=`echo $passwd | cut -d = -f 2`
telnet=`echo $sn | cut -d = -f 2`
if [ "$username" = "$username_s" ] && [ "$passwd" = "$passwd_s" ]
then
if [ "$telnet" = "Yes" ]
then
ret=`/userfs/bin/tcapi set Account_TelnetEntry Active $telnet`
ret=`/userfs/bin/tcapi commit Account_TelnetEntry`
ret=`/userfs/bin/tcapi save`
echo "telnet open."
else
ret=`/userfs/bin/tcapi set Account_TelnetEntry Active $telnet`
ret=`/userfs/bin/tcapi commit Account_TelnetEntry`
ret=`/userfs/bin/tcapi save`
echo "telnet close."
fi
else
echo "username/passwd match fail."
fi
else
echo "no query string."
fi