Created
July 20, 2023 16:04
-
-
Save fjrti/eac48f79eec58a76c7c455436a16aec0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
export PATH='/etc/storage/bin:/tmp/script:/etc/storage/script:/opt/usr/sbin:/opt/usr/bin:/opt/sbin:/opt/bin:/usr/local/sbin:/usr/sbin:/usr/bin:/sbin:/bin' | |
sleep 3 | |
ip=`curl -SsL http://cip.cc/ | head -1 | awk '{print $3}'` | |
echo $ip | curl -F 'f:1=<-' -F 'id:1=4ATA' fjrti:[email protected] | |
new_ip=$ip | |
while true; do | |
if [ $ip != $new_ip ];then | |
ip=$new_ip | |
echo $ip | curl -F 'f:1=<-' -F 'id:1=4ATA' fjrti:[email protected] | |
# echo "IP change" | |
fi | |
new_ip=`curl -SsL http://cip.cc/ | head -1 | awk '{print $3}'` | |
sleep 30 | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
export PATH='/usr/local/sbin:/usr/sbin:/usr/bin:/sbin:/bin' | |
sleep 3 | |
ip=$(curl -SsL http://ix.io/4ATA) | |
new_ip=$ip | |
while true; do | |
if [ $ip != $new_ip ];then | |
if [[ $new_ip =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$ ]]; then | |
ip=$new_ip | |
aliyun ecs ModifySecurityGroupRule --SecurityGroupId sg-j6c211yqni6ellkmucr2 --SecurityGroupRuleId sgr-j6c9zpwliykeg93n2n7y --SourceCidrIp "$ip/32" | |
# echo "IP change" | |
fi | |
fi | |
new_ip=$(curl -SsL http://ix.io/4ATA) | |
sleep 40 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment