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 | |
| accountName='accountName' | |
| IAMUserName='IAMUserName' | |
| IAMUserPassword='IAMUserPassword' | |
| # curl -i -H "Content-Type: application/json;charset=utf8" -d "{\"auth\":{\"identity\":{\"methods\":[\"password\"],\"password\":{\"user\":{\"domain\":{\"name\":\"${accountName}\"},\"name\":\"${IAMUserName}\",\"password\":\"${IAMUserPassword}\"}}},\"scope\":{\"project\":{\"name\":\"cn-north-4\"}}}}" -X "POST" "https://iam.myhuaweicloud.com/v3/auth/tokens" # 获取用户token X-Subject-Token | |
| # curl -H "Content-Type: application/json" -X "GET" --raw "https://dns.myhuaweicloud.com/" # 查询api版本号 |
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 | |
| ## vmess订阅生成脚本,参数1为节点信息的jsonc 列表,参数2为输出 | |
| raw=$(cat "$1" | sed -e 's/\/\/.*//g' -e 's/[[:blank:]]*$//g' -e 's/^[[:blank:]]*//g' | tr -d '\n' | sed -e 's/}{/}\n{/g') | |
| target="$2" | |
| number=$(echo "$raw" | grep -c '{') | |
| for ((i=1;i<="$number";i++)); do | |
| encoded=$(echo "$raw" | sed -n -e "${i} p" | base64 -w 0) | |
| vmess[$i]="vmess://${encoded}" | |
| 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 | |
| PrivateKey=$(wg genkey) | |
| PublicKey=$(echo "$PrivateKey" | wg pubkey) | |
| echo "PublicKey=${PublicKey} # PrivateKey=${PrivateKey}" |
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 | |
| URL='https://ip.zxinc.org/api.php' | |
| curl -sS "$URL" -d "type=json" -d "ip=${1}" | sed -n '2,3p' |
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 | |
| ### 证书更新脚本,附带邮件通知以及Telegram提示与备份 | |
| ### 作用于acme.sh的reloadcmd命令 | |
| ### 使用前需更改参数 | |
| # 证书域名主体 | |
| domain="" | |
| # 服务器地址 |
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 | |
| token='' | |
| domain='' | |
| device='' | |
| historyFile="iphistory_duckdns" | |
| [ -e $historyFile ] && old=`cat $historyFile` | |
| if [ -n "$device" ]; then |
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 | |
| # debug=1 | |
| # 配置生成地址 | |
| serverConfFile='server.conf' | |
| clientConfDir='clients' | |
| # 服务端常量设置 | |
| serverInterfaceConfig=' |
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 | |
| debug=0 | |
| configDir='/etc/wireguard/' # 配置文件夹 /etc/wireguard/ | |
| interfaces=('wg0' 'wg1') # 需要动态的接口 | |
| timeout='180' # 超时时间,以秒记 | |
| url='https://dns.alidns.com/resolve' # doh URL | |
| fontRed='\033[31m' |
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 | |
| ## 订阅生成脚本,参数1为节点信息的jsonc 列表,参数2为输出 | |
| urlencode() { | |
| # urlencode <string> | |
| old_lang=$LANG | |
| LANG=C | |
| old_lc_collate=$LC_COLLATE | |
| LC_COLLATE=C |
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 | |
| urlencode() { | |
| # urlencode <string> | |
| old_lang=$LANG | |
| LANG=C | |
| old_lc_collate=$LC_COLLATE | |
| LC_COLLATE=C | |
| local length="${#1}" | |
| for (( i = 0; i < length; i++ )); do |