-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconnect.sh
More file actions
32 lines (24 loc) · 873 Bytes
/
Copy pathconnect.sh
File metadata and controls
32 lines (24 loc) · 873 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash
account_file="$HOME/.account.txt"
if [ "$1" == "--relogin" ]; then
rm -f "$account_file"
fi
if [ ! -f "$account_file" ] || [ ! -r "$account_file" ] || [ ! -w "$account_file" ]; then
read -p "Enter account: " account
read -sp "Enter password: " password
echo
if ! echo -e "$account\n$password" > "$account_file"; then
echo "Error: Cannot write to $account_file. Check permissions."
exit 1
fi
fi
if [ ! -r "$account_file" ]; then
echo "Error: Cannot read $account_file. Check permissions."
exit 1
fi
account=$(head -n 1 "$account_file")
password=$(tail -n 1 "$account_file")
echo -e "\nlogin with \e[1;32m$account\e[0m, use \e[1;33m--relogin\e[0m to change account\n"
curl 'http://210.28.18.3' --data "DDDDD=$account&upass=$password&0MKKey=" > "$HOME/.report.log"
echo "Test Connection:"
ping baidu.com -c 4