Code Monkey home page Code Monkey logo

change-lightsail-ip's Introduction

说明

脚本需在墙内机器运行,并且运行机器上必须配置好 aws cli 环境,自动检测指定区域所有静态ip的连通性,如果不通,则删除当前静态ip,并新建静态ip绑定至实例。


依赖jq

https://github.com/stedolan/jq

安装jq

wget http://stedolan.github.io/jq/download/linux64/jq -O /usr/local/bin/jq
chmod +x /usr/local/bin/jq

使用方法

下载脚本

wget https://raw.githubusercontent.com/angelsky11/change-lightsail-ip/master/change-lightsail-ip.sh

运行

chmod +x change-lightsail-ip.sh
./change-lightsail-ip.sh YOUR_REGION

YOUR_REGION请参考下表替换修改

地区 地区码
美国东部(俄亥俄) us-east-2
美国东部(弗吉尼亚北部) us-east-1
美国西部(俄勒冈) us-west-2
亚太地区(孟买) ap-south-1
亚太地区(首尔) ap-northeast-2
亚太地区(新加坡) ap-southeast-1
亚太地区(悉尼) ap-southeast-2
亚太地区 (东京) ap-northeast-1
加拿大(中部) ca-central-1
欧洲(法兰克福) eu-central-1
欧洲 (爱尔兰) eu-west-1
欧洲(伦敦) eu-west-2
欧洲(巴黎) eu-west-3

可添加定时任务每10分钟检测一次

运行crontab -e后添加下面一行:

*/10 * * * * /YOUR_PATH/change-lightsail-ip.sh YOUR_REGION

如果不想10分钟一次请自行搜索crontab用法

server酱微信消息推送

https://sc.ftqq.com

修改以下两个参数

#server酱开关,0为关闭,1为开启
NOTIFICATION=0
#server酱api
SERVERCHAN_KEY='YOUR_SERVERCHAN_API'

如有使用问题请先搜索后发信息 https://t.me/angelsky11

change-lightsail-ip's People

Contributors

angelsky11 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.