Skip to content

Instantly share code, notes, and snippets.

@fjrti
Created July 20, 2023 16:04
Show Gist options
  • Save fjrti/eac48f79eec58a76c7c455436a16aec0 to your computer and use it in GitHub Desktop.
Save fjrti/eac48f79eec58a76c7c455436a16aec0 to your computer and use it in GitHub Desktop.
#!/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:fjrti@ix.io
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:fjrti@ix.io
# echo "IP change"
fi
new_ip=`curl -SsL http://cip.cc/ | head -1 | awk '{print $3}'`
sleep 30
done
#!/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