-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[shares] notification scripts #12
Comments
Cloudflare DDNS IP4P(IPv4 and port encoding in AAAA record): #!/bin/sh
ZONE=''
RECORD=''
EMAIL=''
AUTH=''
DOMAIN=''
IP4P=${3}
while true; do
curl -X PUT "https://api.cloudflare.com/client/v4/zones/${ZONE}/dns_records/${RECORD}" \
-H "X-Auth-Email: ${EMAIL}" \
-H "Authorization: Bearer ${AUTH}" \
-H "Content-Type:application/json" \
--data "{\"type\":\"AAAA\",\"name\":\"${DOMAIN}\",\"content\":\"${IP4P}\",\"ttl\":60,\"proxied\":false}" > /dev/null 2> /dev/null
if [ $? -eq 0 ]; then
break
fi
done Applications supports IP4P:
|
Natter/NATMap 打洞后自动更新 qBittorrent/Transmission 监听端口和 OpenWrt 防火墙规则并推送到 Telegram: https://gist.github.com/veltlion/b59d73654f0ae36725f5a571602729cb 据说让BT/PT客户端的侦听端口与打洞后的公网端口保持一致可以有效提高peer间的连通性,从而提升上传速度。 |
ns1.com scripts for update A (IPv4 address) and SRV (port) record. Requires OpenWrt's jshn ( Docs about SRV record: |
qBittorrent 的实现应该没啥问题,是不是受 IPV4、V6 监听端口不一致的影响 好像是 tracker 实现的问题,有些 tracker 只能绑定一个端口 |
dynv6 DDNS IP4P(IPv4 and port encoding in AAAA record): #!/bin/sh
ZONE=''
TOKEN=''
IP4P=${3}
while true; do
curl \
"https://dynv6.com/api/update?hostname=${ZONE}&token=${TOKEN}&ipv6=${IP4P}&ipv6prefix=${IP4P}" \
> /dev/null 2> /dev/null
if [ $? -eq 0 ]; then
break
fi
done |
Fix someting wrong with my openwrt router from https://github.com/heiher/natmap/wiki/web What's more, when you are using HTTP protocol, please create a Configuration Rules (zone-->Rules --> Configuration Rules) to switch SSL option to off for specific subdomain, or turn to use HTTPS
|
自动配置OpenWrt防火墙,将IPv4流量DNAT到内网地址(端口与公网映射端口一致),并且允许同一端口的IPv6流量。
|
@cwbsw 看上去使用这种方案可以让防火墙配置跟随 natmap 服务?重启系统是不是可以自动清除?有相关文档吗? |
@ysc3839 这个不会写入配置文件,停掉natmap,重新加载防火墙就没了。在natmap的启动脚本加上停止时重新加载防火墙的命令可自动化。 |
@cwbsw 去确认了一下代码,使用 |
多层路由 UPNP 映射端口, 当运行natmap设备 及上级路由全dhcp随机IP 时 这个很实用。 #65 `#!/bin/bash if ! type traceroute > /dev/null 2>&1; then if ! type fping > /dev/null 2>&1; then lan_ip=$(ip address show $eth | head -n4 | grep inet | awk '{print$2}' | cut -d/ -f1-1) get_ip (){
|
如果是多个端口映射,配置起来就非常繁琐容易出错 为了方便使用我弄了个在线安装命令: 脚本使用方法: 第二步:Openwrt的编辑_/etc/rc.local_ 第三步:输入 sh /etc/storage/natmap.sh openwrt的 停止运行:sh /etc/natmap.sh 0 重启运行:sh /etc/natmap.sh 卸载:sh /etc/natmap.sh uninstall padavan的 停止运行:sh /etc/storage/natmap.sh 0 重启运行:sh /etc/storage/natmap.sh 卸载:sh /etc/storage/natmap.sh uninstall 目前预编辑几个natmap专用ddns脚本 cf_txt.sh <子域名> <域名> <电子邮箱> cf_ip4p.sh <子域名> <域名> <电子邮箱> dedyn_ip4p.sh <子域名> <域名> dedyn_txt.sh <子域名> <域名> dynv6_ip4p.sh <子域名> <域名> dynv6_aaaa.sh <域名> dynv6_txt.sh <子域名> <域名> freedomain_ip4p.sh <子域名> <域名> freedomain_txt.sh <子域名> <域名> UrlShort_wr.sh <后缀> <服务器> <密码> UrlShort_ssh.sh <后缀> <服务器> <密码> UrlShort_html.sh <后缀> <服务器> <密码> gg_wr.sh <后缀> <电子邮箱> <密码> <link_id> shorten_wr.sh <后缀> <服务器> <密码>
——natmap.sh脚本内容——
|
Welcome to share the notification scripts.
欢迎分享通知脚本。
The text was updated successfully, but these errors were encountered: