upload
This commit is contained in:
commit
4bbc916282
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
.api-key
|
17
shell.sh
Normal file
17
shell.sh
Normal file
@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
|
||||
API_HOST="https://api.ssh.surf"
|
||||
API_KEY=$(cat .api-key)
|
||||
|
||||
[ -z $API_KEY ] && echo "API key not found" && exit 1
|
||||
|
||||
hello=$(curl -w %{http_code} -sH "x-ssh-auth: $API_KEY" $API_HOST/hello -o /dev/null)
|
||||
|
||||
if [[ hello -ne 200 ]]; then
|
||||
echo "token not valid, exiting"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
CONNECTOR=$(curl -sH "x-ssh-auth: $API_KEY" -X POST -H "content-type: application/json" $API_HOST/exec --data '{ "cmd": "con --list | grep ssh - Port: 22", "pwd": "/root" }' | grep -o 'Connector: [^"]*' | sed 's/Connector: //' | sed 's/\\n//')
|
||||
|
||||
npx holesail $CONNECTOR
|
Loading…
Reference in New Issue
Block a user