├── README.md ├── cf-v4-ddns.sh ├── ednovastool.sh ├── root.sh └── swap.sh /README.md: -------------------------------------------------------------------------------- 1 | # EdNovas的Toolbox工具箱 2 | 3 | 简介:整合了一些常用的脚本,会尽量持续更新~ 4 | 5 | - [X] 添加二级目录(由于脚本太多,目前页面太长) 6 | - [X] 整理脚本逻辑顺序 7 | - [X] 添加一键DD脚本,添加关闭ipv6脚本,添加更改ssh端口脚本 8 | - [ ] 添加更多vps程序 9 | - [ ] 所有脚本添加出处 10 | 11 | ## 脚本 12 | 13 | 最新版(该一键脚本已使用jsdelivr cdn,支持纯ipv6访问): 14 | 15 | ``` 16 | wget -P /root -N https://cdn.jsdelivr.net/gh/ednovas/vpstoolbox@main/ednovastool.sh && chmod +x ednovastool.sh && ./ednovastool.sh 17 | ``` 18 | 19 | 工具箱中脚本均来自GitHub,小部分已注明作者 20 | 21 | ## 交流 & BUG反馈 22 | 23 | 有好用的脚本可以提issue或者群内交流 24 | 25 | TG群:https://t.me/ednovas4 26 | 27 | ## 更新进程 28 | 29 | v 1.2.8 快捷方式创建成功,可执行[ednovas]快捷重新打开脚本 30 | 31 | v 1.2.7 添加speedtest-go一键脚本 32 | 33 | v 1.2.6 添加cloudflare ddns脚本 34 | 35 | v 1.2.5 添加一键SWAP,禁ping,改变DNS脚本,同步系统时间 36 | 37 | v 1.2.4 添加了显示一键DD脚本密码 38 | 39 | v 1.2.3 添加了p3trex warp脚本 40 | 41 | v 1.2.2 添加了speedtest-cli一键测速脚本 42 | 43 | v 1.2.1 添加了一键DD脚本,更改ssh端口,关闭/打开ipv6 44 | 45 | v 1.2.0 添加了二级目录,加入了内存信息查看,程序实时占用,硬盘占用查询 46 | 47 | v 1.1.4 添加了三网测速脚本,优化了arm/amd等选项 48 | 49 | v 1.1.3 添加了screen和acme.sh脚本 50 | 51 | v 1.1.2 修复了一些bug 52 | 53 | v 1.1.1 删除了superbench脚本,添加了检测VPS信息 54 | 55 | v 1.1.0 修改了青龙面板一键脚本,添加了检测本机IP,并修复了一些BUG 56 | 57 | v 1.0.9 添加青龙面板一键脚本 58 | 59 | v 1.0.8 修改epic games每周免费游戏领取脚本,并修改部分脚本下载位置为home路径 60 | 61 | v 1.0.7 添加epic games每周免费游戏领取脚本 62 | 63 | v 1.0.6 修改了一些bug 64 | 65 | v 1.0.5 添加teamspeak一键脚本 66 | 67 | v 1.0.4 添加xrayr审计规则 68 | 69 | v 1.0.3 添加rclone脚本 70 | 71 | v 1.0.2 添加cxxmatrix黑客帝国屏保 72 | 73 | v 1.0.1 添加mtproxy+伪tls脚本 74 | 75 | v 1.0.0 创建了该脚本 76 | 77 | ## 脚本 78 | 79 | ![Snipaste_2021-12-31_22-26-12](https://user-images.githubusercontent.com/56779951/147845173-bf7f7d92-2da6-4ab7-80fd-90e264fe6c75.png) 80 | 81 | 一键DD脚本:https://github.com/fcurrk/reinstall 使用教程:https://git.beta.gs/ 82 | 83 | screen后台运行管理脚本:https://github.com/Misaka-blog/screenManager 84 | 85 | acme.sh一键申请证书脚本:https://github.com/Misaka-blog/acme1key 86 | 87 | 青龙面板:https://blog.csdn.net/weixin_42565036/article/details/117569495 88 | 89 | 青龙教程合集:https://www.notion.so/1c598629675145988b43a37998a1604a 90 | 91 | ## 打赏 92 | 93 | USDT(TRC20): 94 | `TQ7zVyrxPCwFj7qkkKVsXjt5QNjomKGq8u` 95 | 96 | ETH: 97 | `0x17a6E2777B1E90240616FC6f14C916B3028Fb259` 98 | 99 | BTC: 100 | `3BVRnt1s7K5RJ8xbopP7jRBYuL8JC7qCWr` 101 | 102 | LTC: 103 | `LQTu2hWc2JRvcXX47U1VVCN5jsVku3hCAb` 104 | -------------------------------------------------------------------------------- /cf-v4-ddns.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -o errexit 3 | set -o nounset 4 | set -o pipefail 5 | 6 | # Automatically update your CloudFlare DNS record to the IP, Dynamic DNS 7 | # Can retrieve cloudflare Domain id and list zone's, because, lazy 8 | 9 | # Place at: 10 | # curl https://raw.githubusercontent.com/yulewang/cloudflare-api-v4-ddns/master/cf-v4-ddns.sh > /usr/local/bin/cf-ddns.sh && chmod +x /usr/local/bin/cf-ddns.sh 11 | # run `crontab -e` and add next line: 12 | # */1 * * * * /usr/local/bin/cf-ddns.sh >/dev/null 2>&1 13 | # or you need log: 14 | # */1 * * * * /usr/local/bin/cf-ddns.sh >> /var/log/cf-ddns.log 2>&1 15 | 16 | 17 | # Usage: 18 | # cf-ddns.sh -k cloudflare-api-key \ 19 | # -u user@example.com \ 20 | # -h host.example.com \ # fqdn of the record you want to update 21 | # -z example.com \ # will show you all zones if forgot, but you need this 22 | # -t A|AAAA # specify ipv4/ipv6, default: ipv4 23 | 24 | # Optional flags: 25 | # -f false|true \ # force dns update, disregard local stored ip 26 | 27 | # default config 28 | 29 | # API key, see https://www.cloudflare.com/a/account/my-account, 30 | # incorrect api-key results in E_UNAUTH error 31 | CFKEY= 32 | 33 | # Username, eg: user@example.com 34 | CFUSER= 35 | 36 | # Zone name, eg: example.com 37 | CFZONE_NAME= 38 | 39 | # Hostname to update, eg: homeserver.example.com 40 | CFRECORD_NAME= 41 | 42 | # Record type, A(IPv4)|AAAA(IPv6), default IPv4 43 | CFRECORD_TYPE=A 44 | 45 | # Cloudflare TTL for record, between 120 and 86400 seconds 46 | CFTTL=60 47 | 48 | # Ignore local file, update ip anyway 49 | FORCE=false 50 | 51 | WANIPSITE="http://ipv4.icanhazip.com" 52 | 53 | # Site to retrieve WAN ip, other examples are: bot.whatismyipaddress.com, https://api.ipify.org/ ... 54 | if [ "$CFRECORD_TYPE" = "A" ]; then 55 | : 56 | elif [ "$CFRECORD_TYPE" = "AAAA" ]; then 57 | WANIPSITE="http://ipv6.icanhazip.com" 58 | else 59 | echo "$CFRECORD_TYPE specified is invalid, CFRECORD_TYPE can only be A(for IPv4)|AAAA(for IPv6)" 60 | exit 2 61 | fi 62 | 63 | # get parameter 64 | while getopts k:u:h:z:t:f: opts; do 65 | case ${opts} in 66 | k) CFKEY=${OPTARG} ;; 67 | u) CFUSER=${OPTARG} ;; 68 | h) CFRECORD_NAME=${OPTARG} ;; 69 | z) CFZONE_NAME=${OPTARG} ;; 70 | t) CFRECORD_TYPE=${OPTARG} ;; 71 | f) FORCE=${OPTARG} ;; 72 | esac 73 | done 74 | 75 | # If required settings are missing just exit 76 | if [ "$CFKEY" = "" ]; then 77 | echo "Missing api-key, get at: https://www.cloudflare.com/a/account/my-account" 78 | echo "and save in ${0} or using the -k flag" 79 | exit 2 80 | fi 81 | if [ "$CFUSER" = "" ]; then 82 | echo "Missing username, probably your email-address" 83 | echo "and save in ${0} or using the -u flag" 84 | exit 2 85 | fi 86 | if [ "$CFRECORD_NAME" = "" ]; then 87 | echo "Missing hostname, what host do you want to update?" 88 | echo "save in ${0} or using the -h flag" 89 | exit 2 90 | fi 91 | 92 | # If the hostname is not a FQDN 93 | if [ "$CFRECORD_NAME" != "$CFZONE_NAME" ] && ! [ -z "${CFRECORD_NAME##*$CFZONE_NAME}" ]; then 94 | CFRECORD_NAME="$CFRECORD_NAME.$CFZONE_NAME" 95 | echo " => Hostname is not a FQDN, assuming $CFRECORD_NAME" 96 | fi 97 | 98 | # Get current and old WAN ip 99 | WAN_IP=`curl -s ${WANIPSITE}` 100 | WAN_IP_FILE=$HOME/.cf-wan_ip_$CFRECORD_NAME.txt 101 | if [ -f $WAN_IP_FILE ]; then 102 | OLD_WAN_IP=`cat $WAN_IP_FILE` 103 | else 104 | echo "No file, need IP" 105 | OLD_WAN_IP="" 106 | fi 107 | 108 | # If WAN IP is unchanged an not -f flag, exit here 109 | if [ "$WAN_IP" = "$OLD_WAN_IP" ] && [ "$FORCE" = false ]; then 110 | echo "WAN IP Unchanged, to update anyway use flag -f true" 111 | exit 0 112 | fi 113 | 114 | # Get zone_identifier & record_identifier 115 | ID_FILE=$HOME/.cf-id_$CFRECORD_NAME.txt 116 | if [ -f $ID_FILE ] && [ $(wc -l $ID_FILE | cut -d " " -f 1) == 4 ] \ 117 | && [ "$(sed -n '3,1p' "$ID_FILE")" == "$CFZONE_NAME" ] \ 118 | && [ "$(sed -n '4,1p' "$ID_FILE")" == "$CFRECORD_NAME" ]; then 119 | CFZONE_ID=$(sed -n '1,1p' "$ID_FILE") 120 | CFRECORD_ID=$(sed -n '2,1p' "$ID_FILE") 121 | else 122 | echo "Updating zone_identifier & record_identifier" 123 | CFZONE_ID=$(curl -s -X GET "https://api.cloudflare.com/client/v4/zones?name=$CFZONE_NAME" -H "X-Auth-Email: $CFUSER" -H "X-Auth-Key: $CFKEY" -H "Content-Type: application/json" | grep -Po '(?<="id":")[^"]*' | head -1 ) 124 | CFRECORD_ID=$(curl -s -X GET "https://api.cloudflare.com/client/v4/zones/$CFZONE_ID/dns_records?name=$CFRECORD_NAME" -H "X-Auth-Email: $CFUSER" -H "X-Auth-Key: $CFKEY" -H "Content-Type: application/json" | grep -Po '(?<="id":")[^"]*' | head -1 ) 125 | echo "$CFZONE_ID" > $ID_FILE 126 | echo "$CFRECORD_ID" >> $ID_FILE 127 | echo "$CFZONE_NAME" >> $ID_FILE 128 | echo "$CFRECORD_NAME" >> $ID_FILE 129 | fi 130 | 131 | # If WAN is changed, update cloudflare 132 | echo "Updating DNS to $WAN_IP" 133 | 134 | RESPONSE=$(curl -s -X PUT "https://api.cloudflare.com/client/v4/zones/$CFZONE_ID/dns_records/$CFRECORD_ID" \ 135 | -H "X-Auth-Email: $CFUSER" \ 136 | -H "X-Auth-Key: $CFKEY" \ 137 | -H "Content-Type: application/json" \ 138 | --data "{\"id\":\"$CFZONE_ID\",\"type\":\"$CFRECORD_TYPE\",\"name\":\"$CFRECORD_NAME\",\"content\":\"$WAN_IP\", \"ttl\":$CFTTL}") 139 | 140 | if [ "$RESPONSE" != "${RESPONSE%success*}" ] && [ "$(echo $RESPONSE | grep "\"success\":true")" != "" ]; then 141 | echo "Updated succesfuly!" 142 | echo $WAN_IP > $WAN_IP_FILE 143 | exit 144 | else 145 | echo 'Something went wrong :(' 146 | echo "Response: $RESPONSE" 147 | exit 1 148 | fi 149 | -------------------------------------------------------------------------------- /ednovastool.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ver="1.2.10" 3 | changeLog="添加了回程检测脚本,优化了部分脚本,修复了一些bug" 4 | arch=`uname -m` 5 | virt=`systemd-detect-virt` 6 | kernelVer=`uname -r` 7 | hostnameVariable=`hostname` 8 | 9 | green(){ 10 | echo -e "\033[32m\033[01m$1\033[0m" 11 | } 12 | red(){ 13 | echo -e "\033[31m\033[01m$1\033[0m" 14 | } 15 | yellow(){ 16 | echo -e "\033[33m\033[01m$1\033[0m" 17 | } 18 | 19 | 20 | if [[ -f /etc/redhat-release ]]; then 21 | release="Centos" 22 | elif cat /etc/issue | grep -q -E -i "debian"; then 23 | release="Debian" 24 | elif cat /etc/issue | grep -q -E -i "ubuntu"; then 25 | release="Ubuntu" 26 | elif cat /etc/issue | grep -q -E -i "centos|red hat|redhat"; then 27 | release="Centos" 28 | elif cat /proc/version | grep -q -E -i "debian"; then 29 | release="Debian" 30 | elif cat /proc/version | grep -q -E -i "ubuntu"; then 31 | release="Ubuntu" 32 | elif cat /proc/version | grep -q -E -i "centos|red hat|redhat"; then 33 | release="Centos" 34 | else 35 | red "不支持你当前系统,请使用Ubuntu,Debian,Centos系统" 36 | rm -f ednovastool.sh 37 | exit 1 38 | fi 39 | 40 | if ! type curl >/dev/null 2>&1; then 41 | yellow "检测到curl未安装,安装中 " 42 | if [ $release = "Centos" ]; then 43 | yum -y update && yum install curl -y 44 | else 45 | apt-get update -y && apt-get install curl -y 46 | fi 47 | else 48 | green "curl已安装" 49 | fi 50 | 51 | if ! type wget >/dev/null 2>&1; then 52 | yellow "检测到wget未安装,安装中 " 53 | if [ $release = "Centos" ]; then 54 | yum -y update && yum install wget -y 55 | else 56 | apt-get update -y && apt-get install wget -y 57 | fi 58 | else 59 | green "wget已安装" 60 | fi 61 | 62 | if ! type sudo >/dev/null 2>&1; then 63 | yellow "检测到sudo未安装,安装中 " 64 | if [ $release = "Centos" ]; then 65 | yum -y update && yum install sudo -y 66 | else 67 | apt-get update -y && apt-get install sudo -y 68 | fi 69 | else 70 | green "sudo已安装" 71 | fi 72 | 73 | 74 | 75 | function Get_Ip_Address(){ 76 | getIpAddress=$(curl ip.p3terx.com) 77 | } 78 | 79 | 80 | 81 | 82 | 83 | # ==============part1============= 84 | 85 | function ddonekey(){ 86 | green "重装的系统说明:" 87 | read -r -p "我已保存好默认root密码,并了解重装后VPS所有内容将会被清除[Y/n] " input 88 | 89 | case $input in 90 | [yY][eE][sS]|[yY]) 91 | wget --no-check-certificate -O AutoReinstall.sh https://git.io/betags && chmod a+x AutoReinstall.sh && bash AutoReinstall.sh 92 | ;; 93 | 94 | [nN][oO]|[nN]) 95 | vpsBasic 96 | ;; 97 | 98 | *) 99 | echo "Invalid input..." 100 | vpsBasic 101 | ;; 102 | esac 103 | } 104 | 105 | function closeipv6(){ 106 | sed -i "\$anet.ipv6.conf.all.disable_ipv6=1" /etc/sysctl.conf 107 | sed -i "\$anet.ipv6.conf.default.disable_ipv6=1" /etc/sysctl.conf 108 | sysctl -p && sysctl --system 109 | } 110 | 111 | function openipv6(){ 112 | sudo sed -i 's/net.ipv6.conf.all.disable_ipv6=1/#net.ipv6.conf.all.disable_ipv6=1/g' /etc/sysctl.conf 113 | sudo sed -i 's/net.ipv6.conf.default.disable_ipv6=1/#net.ipv6.conf.default.disable_ipv6=1/g' /etc/sysctl.conf 114 | sysctl -p && sysctl --system 115 | } 116 | 117 | function addipv6(){ 118 | read -p "请输入你要添加的IPV6地址(IPV6 Address),带/64或/128:" IPV6ADDRESS 119 | read -p "请输入你要添加的IPV6地址的网关(Gateway):" IPV6GATEWAY 120 | apt install net-tools -y 121 | ifconfig 122 | read -p "请输入你要添加的网卡名(例如“ens3”):" NETWORKNAME 123 | ip addr add $IPV6ADDRESS dev $NETWORKNAME 124 | ip -6 route add $IPV6GATEWAY dev $NETWORKNAME 125 | ip -6 route add default via $IPV6GATEWAY dev $NETWORKNAME 126 | curl -6 ip.p3terx.com 127 | } 128 | 129 | function changesshport(){ 130 | green "请输入你要更改为的ssh端口(1024-65535)" 131 | read -p "请输入你要更改为的ssh端口(1024-65535):" changedsshport 132 | if [$changedsshport < 1024 ||] 133 | then 134 | read -p "输入不合法,请重新输入你要更改的ssh端口(1024-65535):" changedsshport 135 | fi 136 | 137 | if [ -e "/etc/ssh/sshd_config" ];then 138 | [ -z "`grep ^Port /etc/ssh/sshd_config`" ] && ssh_port=22 || ssh_port=`grep ^Port /etc/ssh/sshd_config | awk '{print $2}'` 139 | while :; do echo 140 | read -p "请输入你要更改为的端口,端口范围为1025-65534(默认: $ssh_port): " SSH_PORT 141 | [ -z "$SSH_PORT" ] && SSH_PORT=$ssh_port 142 | if [ $SSH_PORT -eq 22 >/dev/null 2>&1 -o $SSH_PORT -gt 1024 >/dev/null 2>&1 -a $SSH_PORT -lt 65535 >/dev/null 2>&1 ];then 143 | break 144 | else 145 | echo "${CWARNING}不合法的输入!端口范围: 22,1025~65534${CEND}" 146 | fi 147 | done 148 | 149 | if [ -z "`grep ^Port /etc/ssh/sshd_config`" -a "$SSH_PORT" != '22' ];then 150 | sed -i "s@^#Port.*@&\nPort $SSH_PORT@" /etc/ssh/sshd_config 151 | elif [ -n "`grep ^Port /etc/ssh/sshd_config`" ];then 152 | sed -i "s@^Port.*@Port $SSH_PORT@" /etc/ssh/sshd_config 153 | fi 154 | fi 155 | } 156 | 157 | function rootLogin(){ 158 | wget -N https://raw.githubusercontent.com/wdm1732418365/vpstoolbox/main/root.sh && chmod -R 755 root.sh && bash root.sh 159 | } 160 | 161 | function vpsupdate(){ 162 | if [ $release = "Centos" ]; then 163 | yum update -y 164 | yum update -y && apt-get install curl -y 165 | else 166 | apt update -y 167 | apt-get update -y && apt-get install curl -y 168 | fi 169 | } 170 | 171 | function oraclefirewall(){ 172 | if [ $release = "Centos" ]; then 173 | systemctl stop oracle-cloud-agent 174 | systemctl disable oracle-cloud-agent 175 | systemctl stop oracle-cloud-agent-updater 176 | systemctl disable oracle-cloud-agent-updater 177 | systemctl stop firewalld.service 178 | systemctl disable firewalld.service 179 | else 180 | iptables -P INPUT ACCEPT 181 | iptables -P FORWARD ACCEPT 182 | iptables -P OUTPUT ACCEPT 183 | iptables -F 184 | apt-get purge netfilter-persistent -y 185 | fi 186 | } 187 | 188 | 189 | 190 | function centosfirewall(){ 191 | systemctl stop firewalld 192 | systemctl disable firewalld 193 | } 194 | 195 | function ubuntufirewall(){ 196 | ufw disable 197 | iptables -P INPUT ACCEPT 198 | iptables -P FORWARD ACCEPT 199 | iptables -P OUTPUT ACCEPT 200 | iptables -F 201 | } 202 | 203 | function changehostname(){ 204 | read -p "您的新主机名(Your new hostname):" newhostname 205 | hostnamectl set-hostname $newhostname 206 | green "修改完成,请重新连接ssh或重新启动服务器!" 207 | green "Finished! Please reconnect to ssh or reboot your vps" 208 | } 209 | 210 | function ipdetestonekey(){ 211 | yellow "'curl: (7) Couldn't connect to server' 即表示无IPV4/IPV6地址" 212 | green "IPV4地址为:" 213 | curl -4 ip.p3terx.com 214 | green "IPV6地址为:" 215 | curl -6 ip.p3terx.com 216 | } 217 | 218 | function driveSpace(){ 219 | df -h 220 | } 221 | 222 | function memorySpace(){ 223 | free -m 224 | } 225 | 226 | function realTimeProgress(){ 227 | green "ctrl + c 退出" 228 | sleep 2 229 | top 230 | } 231 | 232 | function synctime(){ 233 | if [ $release = "Centos" ]; then 234 | yum -y install ntpdate 235 | ntpdate -u pool.ntp.org 236 | date 237 | else 238 | apt -y install ntpdate 239 | ntpdate -u pool.ntp.org 240 | date 241 | fi 242 | } 243 | 244 | function changednscn(){ 245 | echo -e "options timeout:1 attempts:1 rotate\nnameserver 223.5.5.5\nnameserver 119.29.29.29">/etc/resolv.conf; 246 | cat /etc/resolv.conf 247 | } 248 | 249 | function changednsgoogle(){ 250 | echo -e "options timeout:1 attempts:1 rotate\nnameserver 8.8.8.8\nnameserver 8.8.4.4" >/etc/resolv.conf; 251 | cat /etc/resolv.conf 252 | } 253 | 254 | function changednscombine(){ 255 | echo -e "options timeout:1 attempts:1 rotate\nnameserver 223.5.5.5\nnameserver 8.8.4.4" >/etc/resolv.conf; 256 | cat /etc/resolv.conf 257 | } 258 | 259 | function changedns(){ 260 | echo "1. Google DNS" 261 | echo "2. CloudFlare DNS" 262 | echo "3. 国内阿里&腾讯 DNS" 263 | echo "4. 国内阿里&国外腾讯 DNS" 264 | echo "0. 反回上一级" 265 | echo " " 266 | read -p "请输入选项:" dnschanges 267 | case "$dnschanges" in 268 | 1 ) changednsgoogle ;; 269 | 2 ) changednscf ;; 270 | 3 ) changednscn ;; 271 | 4 ) changednscombine ;; 272 | 0 ) vpsBasic ;; 273 | esac 274 | } 275 | 276 | function addswap(){ 277 | wget https://raw.githubusercontent.com/wdm1732418365/vpstoolbox/main/swap.sh && bash swap.sh 278 | } 279 | 280 | function nopingin(){ 281 | iptables -A INPUT -p icmp --icmp-type 8 -s 0/0 -j DROP 282 | } 283 | 284 | function yespingin(){ 285 | iptables -D INPUT -p icmp --icmp-type 8 -s 0/0 -j DROP 286 | } 287 | 288 | function nopinginout(){ 289 | echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_all 290 | } 291 | 292 | function yespinginout(){ 293 | echo 0 > /proc/sys/net/ipv4/icmp_echo_ignore_all 294 | } 295 | 296 | function noping(){ 297 | echo "1. 禁ping入" 298 | echo "2. 恢复ping入" 299 | echo "3. 禁ping入和出" 300 | echo "4. 恢复ping入和出" 301 | echo "0. 反回上一级" 302 | echo " " 303 | read -p "请输入选项:" nopingswitch 304 | case "$nopingswitch" in 305 | 1 ) changednsgoogle ;; 306 | 2 ) changednscf ;; 307 | 3 ) changednscn ;; 308 | 4 ) changednscombine ;; 309 | 0 ) vpsBasic ;; 310 | esac 311 | } 312 | 313 | function cloudflareddns(){ 314 | curl https://raw.githubusercontent.com/EdNovas/vpstoolbox/main/cf-v4-ddns.sh > /root/cf-v4-ddns.sh && chmod +x /root/cf-v4-ddns.sh 315 | read -p "请输入你的Cloudflare邮箱地址: " cloudflareemail 316 | read -p "请输入你的Cloudflare API: " cloudflareapi 317 | read -p "请输入你的主域名(example.com):" cloudflaredomain 318 | read -p "请输入你的Hostname(homeserver.example.com):" cloudflarehostname 319 | sed -i "s/CFUSER=$/CFUSER=$cloudflareemail/g" /root/cf-v4-ddns.sh 320 | sed -i "s/CFKEY=$/CFKEY=$cloudflareapi/g" /root/cf-v4-ddns.sh 321 | sed -i "s/CFZONE_NAME=$/CFZONE_NAME=$cloudflaredomain/g" /root/cf-v4-ddns.sh 322 | sed -i "s/CFRECORD_NAME=$/CFRECORD_NAME=$cloudflarehostname/g" /root/cf-v4-ddns.sh 323 | if [ $release = "Centos" ]; then 324 | echo "*/2 * * * * /root/cf-v4-ddns.sh >/dev/null 2>&1" >> /etc/crontab 325 | else 326 | echo "*/2 * * * * /root/cf-v4-ddns.sh >/dev/null 2>&1" >> /var/spool/cron/crontabs/root 327 | fi 328 | ./cf-v4-ddns.sh 329 | } 330 | 331 | function ipv4first(){ 332 | sed -i 's/#precedence ::ffff:0:0\/96 100/precedence ::ffff:0:0\/96 100/' /etc/gai.conf 333 | curl ip.sb 334 | } 335 | 336 | function ipv6first(){ 337 | sed -i 's/precedence ::ffff:0:0\/96 100/#precedence ::ffff:0:0\/96 100/' /etc/gai.conf 338 | echo "label 2002::/16 2" >> /etc/gai.conf 339 | curl ip.sb 340 | } 341 | 342 | function changenat64(){ 343 | echo -e "nameserver 2a01:4f8:c2c:123f::1\nnameserver 2a00:1098:2c::1\nnameserver 2a01:4f9:c010:3f02::1" > /etc/resolv.conf 344 | green "DNS已更改为 2a01:4f9:c010:3f02::1" 345 | green "2a00:1098:2c::1" 346 | green "2a01:4f8:c2c:123f::1" 347 | } 348 | 349 | function changetrex(){ 350 | echo -e "nameserver 2001:67c:2b0::4\nnameserver 2001:67c:2b0::6" > /etc/resolv.conf 351 | green "DNS已更改为 2001:67c:2b0::4" 352 | green "2001:67c:2b0::6" 353 | } 354 | 355 | function changego6lab(){ 356 | echo -e "nameserver 2001:67c:27e4:15::6411\nnameserver 2001:67c:27e4::64" > /etc/resolv.conf 357 | green "DNS已更改为 2001:67c:27e4:15::6411" 358 | green "2001:67c:27e4::64" 359 | } 360 | 361 | function addDNS64(){ 362 | echo "1. 使用 https://nat64.net/ DNS64" 363 | echo "2. 使用 http://www.trex.fi/2011/dns64.html DNS64" 364 | echo "3. 使用 https://go6lab.si/current-ipv6-tests/nat64dns64-public-test/ DNS64" 365 | echo "0. 反回上一级" 366 | echo " " 367 | read -p "请输入选项:" dns64switch 368 | case "$dns64switch" in 369 | 1 ) changenat64 ;; 370 | 2 ) changetrex ;; 371 | 3 ) changego6lab ;; 372 | 0 ) vpsBasic ;; 373 | esac 374 | } 375 | 376 | # ==============part1============= 377 | 378 | 379 | 380 | 381 | 382 | # ==============part2============= 383 | 384 | function speedtest-clionekey(){ 385 | if [ $release = "Centos" ]; then 386 | curl -s https://packagecloud.io/install/repositories/ookla/speedtest-cli/script.rpm.sh | sudo bash 387 | sudo yum install speedtest -y 388 | speedtest 389 | else 390 | curl -s https://packagecloud.io/install/repositories/ookla/speedtest-cli/script.deb.sh | sudo bash 391 | sudo apt-get install speedtest -y 392 | speedtest 393 | fi 394 | } 395 | 396 | function benchonekey(){ 397 | wget -qO- bench.sh | bash 398 | } 399 | 400 | function superbench(){ 401 | wget -qO- --no-check-certificate https://raw.githubusercontent.com/oooldking/script/master/superbench.sh | bash 402 | } 403 | 404 | function superspeed(){ 405 | bash <(curl -Lso- https://git.io/superspeed) 406 | } 407 | 408 | function lemonbench(){ 409 | curl -fsL https://ilemonra.in/LemonBenchIntl | bash -s fast 410 | } 411 | 412 | function speedtest-go(){ 413 | bash <(curl -Lsk https://raw.githubusercontent.com/BigMangos/speedtest-go-script/master/install.sh) 414 | } 415 | 416 | function routetrace(){ 417 | wget -qO- git.io/besttrace | bash 418 | } 419 | 420 | function routetracesimple(){ 421 | curl https://raw.githubusercontent.com/zhanghanyun/backtrace/main/install.sh -sSf | sh 422 | } 423 | 424 | function yabs(){ 425 | curl -sL yabs.sh | bash 426 | } 427 | 428 | # ==============part2============= 429 | 430 | 431 | 432 | 433 | 434 | # ==============part3============= 435 | function macka(){ 436 | wget -P /root -N --no-check-certificate "https://raw.githubusercontent.com/ednovas/v2ray-agent/master/install.sh" && chmod 700 /root/install.sh && /root/install.sh 437 | } 438 | 439 | 440 | function xui(){ 441 | bash <(curl -Ls https://raw.githubusercontent.com/vaxilu/x-ui/master/install.sh) 442 | } 443 | 444 | function ssronekey(){ 445 | bash <(curl -sL https://storage.googleapis.com/tiziblog/ssr.sh) 446 | } 447 | 448 | 449 | function xrayronekey(){ 450 | bash <(curl -Ls https://raw.githubusercontent.com/XrayR-project/XrayR-release/master/install.sh) 451 | cd /etc/XrayR 452 | } 453 | 454 | 455 | function rulelist(){ 456 | cd /etc/XrayR 457 | wget https://raw.githubusercontent.com/wdm1732418365/rulelist/main/rulelist 458 | sudo sed -i 's/RuleListPath:/RuleListPath: \/etc\/XrayR\/rulelist/g' /etc/XrayR/config.yml 459 | xrayr restart 460 | } 461 | 462 | function mtproxyonekey(){ 463 | mkdir /home/mtproxy && cd /home/mtproxy 464 | curl -s -o mtproxy.sh https://raw.githubusercontent.com/ellermister/mtproxy/master/mtproxy.sh && chmod +x mtproxy.sh && bash mtproxy.sh 465 | } 466 | 467 | function sursharkinstall(){ 468 | sudo wget https://ocean.surfshark.com/debian/pool/main/s/surfshark-release/surfshark-release_1.0.0-2_amd64.deb 469 | sudo dpkg -i surfshark-release_1.0.0-2_amd64.deb 470 | sudo apt-get update -y 471 | sudo apt-get install surfshark-vpn -y 472 | sudo surfshark-vpn 473 | } 474 | 475 | function expressinstall(){ 476 | sudo wget https://www.expressvpn.works/clients/linux/expressvpn_3.48.0.4-1_amd64.deb 477 | sudo dpkg -i expressvpn_3.39.0.8-1_amd64.deb 478 | sudo expressvpn activate 479 | } 480 | 481 | function tcponekey(){ 482 | wget https://raw.githubusercontent.com/wdm1732418365/bbr-tcp-boost/main/tools.sh -O tools.sh && bash tools.sh 483 | } 484 | 485 | function bbronekey(){ 486 | wget -N --no-check-certificate "https://raw.githubusercontent.com/chiakge/Linux-NetSpeed/master/tcp.sh" && chmod +x tcp.sh && ./tcp.sh 487 | } 488 | 489 | 490 | function ovzbbr(){ 491 | wget --no-cache -O lkl-haproxy.sh https://github.com/mzz2017/lkl-haproxy/raw/master/lkl-haproxy.sh && bash lkl-haproxy.sh 492 | } 493 | 494 | function wireguardonekey(){ 495 | sudo apt install iproute2 openresolv -y 496 | sudo apt install wireguard-tools --no-install-recommends 497 | sudo apt install iptables -y 498 | cd /etc/wireguard 499 | } 500 | 501 | function l2tponekey(){ 502 | wget --no-check-certificate https://raw.githubusercontent.com/teddysun/across/master/l2tp.sh 503 | chmod +x l2tp.sh 504 | ./l2tp.sh 505 | } 506 | 507 | function sogaonekey(){ 508 | bash <(curl -Ls https://raw.githubusercontent.com/vaxilu/soga/master/install.sh) 509 | cd /etc/soga 510 | } 511 | 512 | # ==============part3============= 513 | 514 | 515 | 516 | 517 | 518 | 519 | # ==============part4============= 520 | 521 | function region(){ 522 | bash <(curl -L -s https://raw.githubusercontent.com/lmc999/RegionRestrictionCheck/main/check.sh) 523 | } 524 | 525 | function netflixdetect(){ 526 | if [ $arch = "aarch64" ]; then 527 | wget -O nf https://github.com/sjlleo/netflix-verify/releases/download/2.61/nf_2.61_linux_arm64 && chmod +x nf && clear && ./nf 528 | else 529 | wget -O nf https://github.com/sjlleo/netflix-verify/releases/download/2.61/nf_2.61_linux_amd64 && chmod +x nf && clear && ./nf 530 | fi 531 | } 532 | 533 | function warponekey(){ 534 | wget -N https://gitlab.com/fscarmen/warp/-/raw/main/menu.sh && bash menu.sh [option] [lisence/url/token] 535 | } 536 | 537 | function warpgoonekey(){ 538 | wget -N https://gitlab.com/fscarmen/warp/-/raw/main/warp-go.sh && bash warp-go.sh [option] [lisence] 539 | } 540 | 541 | function acacia233(){ 542 | curl -sL https://raw.githubusercontent.com/acacia233/Project-WARP-Unlock/main/run.sh | bash 543 | } 544 | 545 | 546 | function georgexie2333(){ 547 | wget https://github.com/GeorgeXie2333/Project-WARP-Unlock/raw/main/warp_change_ip.sh && chmod +x warp_change_ip.sh && ./warp_change_ip.sh 548 | } 549 | 550 | function georgexie2333onekey(){ 551 | if [ $arch = "aarch64" ]; then 552 | curl -sL https://raw.githubusercontent.com/GeorgeXie2333/Project-WARP-Unlock/main/run_arm.sh | bash 553 | else 554 | curl -sL https://raw.githubusercontent.com/GeorgeXie2333/Project-WARP-Unlock/main/run.sh | bash 555 | fi 556 | } 557 | 558 | function tiktokcheck(){ 559 | bash <(curl -s https://raw.githubusercontent.com/lmc999/TikTokCheck/main/tiktok.sh) 560 | } 561 | # ==============part4============= 562 | 563 | 564 | 565 | 566 | 567 | 568 | # ==============part5============= 569 | function brookonekey(){ 570 | wget -N --no-check-certificate http://xiaojier.mooncloud.top/backup/brook-pf-mod.sh && bash brook-pf-mod.sh 571 | } 572 | 573 | function socatonekey(){ 574 | wget https://www.moerats.com/usr/shell/socat.sh && bash socat.sh 575 | } 576 | 577 | function iptablesonekey(){ 578 | wget -N --no-check-certificate https://www.vrrmr.net/Code/iptables-pf.sh && chmod +x iptables-pf.sh && bash iptables-pf.sh 579 | } 580 | 581 | function gostonekey(){ 582 | wget --no-check-certificate -O gost.sh http://xiaojier.mooncloud.top/backup/gost.sh && chmod +x gost.sh && ./gost.sh 583 | } 584 | # ==============part5============= 585 | 586 | 587 | 588 | 589 | 590 | 591 | 592 | # ==============part6============= 593 | function aria2onekey(){ 594 | if [ $release = "Centos" ]; then 595 | yum install wget curl ca-certificates && wget -N git.io/aria2.sh && chmod +x aria2.sh && ./aria2.sh 596 | else 597 | apt install wget curl ca-certificates && wget -N git.io/aria2.sh && chmod +x aria2.sh && ./aria2.sh 598 | fi 599 | } 600 | 601 | function aapanel(){ 602 | if [ $release = "Centos" ]; then 603 | yum install -y wget && wget -O install.sh http://www.aapanel.com/script/install_6.0_en.sh && bash install.sh forum 604 | elif [ $release = "Debian" ]; then 605 | wget -O install.sh http://www.aapanel.com/script/install-ubuntu_6.0_en.sh && bash install.sh forum 606 | else 607 | wget -O install.sh http://www.aapanel.com/script/install-ubuntu_6.0_en.sh && sudo bash install.sh forum 608 | fi 609 | } 610 | 611 | function nezha(){ 612 | curl -L https://raw.githubusercontent.com/naiba/nezha/master/script/install.sh -o nezha.sh && chmod +x nezha.sh && sudo ./nezha.sh 613 | } 614 | 615 | function dockeronekey(){ 616 | curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun 617 | } 618 | 619 | function rcloneonekey(){ 620 | curl https://rclone.org/install.sh | sudo bash 621 | } 622 | 623 | function acmeonekey(){ 624 | wget -N https://cdn.jsdelivr.net/gh/Misaka-blog/acme1key@master/acme1key.sh && chmod -R 777 acme1key.sh && bash acme1key.sh 625 | } 626 | 627 | function screenonekey(){ 628 | wget -N https://cdn.jsdelivr.net/gh/Misaka-blog/screenManager@master/screen.sh && chmod -R 777 screen.sh && bash screen.sh 629 | } 630 | # ==============part6============= 631 | 632 | 633 | 634 | 635 | 636 | 637 | 638 | # ==============part7============= 639 | function teamspeakonekey(){ 640 | if [ $release = "Centos" ]; then 641 | yum install vim wget perl tar net-tools bzip2 -y 642 | else 643 | apt install vim wget perl tar net-tools bzip2 -y 644 | fi 645 | cd /home 646 | wget https://files.teamspeak-services.com/releases/server/3.13.6/teamspeak3-server_linux_amd64-3.13.6.tar.bz2 647 | tar -xjvf teamspeak3-server_linux_amd64-3.13.6.tar.bz2 648 | mkdir teamspeak 649 | mv teamspeak3-server_linux_amd64/* teamspeak 650 | rm -rf teamspeak3-server_linux_amd64 651 | cd teamspeak 652 | touch .ts3server_license_accepted 653 | ./ts3server_startscript.sh start 654 | } 655 | 656 | function cxxmatrix(){ 657 | if [ $release = "Centos" ]; then 658 | sudo yum install make 659 | sudo yum install g++ -y 660 | else 661 | sudo apt install make 662 | sudo apt install g++ -y 663 | fi 664 | cd /home 665 | git clone https://github.com/akinomyoga/cxxmatrix.git 666 | cd cxxmatrix 667 | make 668 | ./cxxmatrix 'The Matrix' 'Reloaded' 669 | } 670 | 671 | function epicgamesonekey(){ 672 | if [ $release = "Centos" ]; then 673 | yum install python3-pip -y 674 | else 675 | apt install python3-pip -y 676 | fi 677 | cd /home 678 | git clone -b main https://github.com/EdNovas/epicgames.git 679 | cd epicgames-claimer 680 | pip3 install -r requirements.txt 681 | sudo sh install_dependencies.sh 682 | python3 main.py 683 | } 684 | 685 | function qinglongonekey(){ 686 | curl -fsSL https://get.docker.com/ | sh 687 | sudo systemctl start docker 688 | sudo systemctl enable docker 689 | docker run -dit --name QL --hostname QL --restart always -p 5700:5700 -v $PWD/QL/config:/ql/config -v $PWD/QL/log:/ql/log -v $PWD/QL/db:/ql/db -v $PWD/QL/scripts:/ql/scripts -v $PWD/QL/jbot:/ql/jbot whyour/qinglong:latest 690 | echo "安装成功,访问 https://${getIpAddress}:5700 即可登录青龙面板,记得开放5700端口!" 691 | echo "用户名为 admin 密码是 adminadmin" 692 | } 693 | # ==============part7============= 694 | 695 | 696 | 697 | 698 | 699 | # ==============part8============= 700 | 701 | function reallyNothing(){ 702 | echo "都说了真的没东西啦!" 703 | } 704 | 705 | # ==============part8============= 706 | 707 | 708 | 709 | 710 | # ==============part9============= 711 | function updateScript(){ 712 | wget -N https://raw.githubusercontent.com/ednovas/vpstoolbox/main/ednovastool.sh && chmod +x ednovastool.sh && ./ednovastool.sh 713 | } 714 | # ==============part9============= 715 | 716 | 717 | 718 | function aliasInstall() { 719 | 720 | if [[ -f "$HOME/ednovastool.sh" ]] && [[ -d "/etc/ednovastool" ]] && grep <"$HOME/ednovastool.sh" -q "作者:EdNovas"; then 721 | mv "$HOME/ednovastool.sh" /etc/ednovastool/ednovastool.sh 722 | local installedN= 723 | if [[ -d "/usr/bin/" ]]; then 724 | if [[ ! -f "/usr/bin/ednovas" ]]; then 725 | ln -s /etc/ednovastool/ednovastool.sh /usr/bin/ednovas 726 | chmod 700 /usr/bin/ednovas 727 | installedN=true 728 | fi 729 | 730 | rm -rf "$HOME/ednovastool.sh" 731 | elif [[ -d "/usr/sbin" ]]; then 732 | if [[ ! -f "/usr/sbin/ednovas" ]]; then 733 | ln -s /etc/ednovastool/ednovastool.sh /usr/sbin/ednovas 734 | chmod 700 /usr/sbin/ednovas 735 | installedN=true 736 | fi 737 | rm -rf "$HOME/ednovastool.sh" 738 | fi 739 | if [[ "${installedN}" == "true" ]]; then 740 | echoContent green "快捷方式创建成功,可执行[ednovas]重新打开脚本" 741 | fi 742 | fi 743 | } 744 | 745 | 746 | 747 | 748 | 749 | 750 | # part 1 751 | function vpsBasic() { 752 | clear 753 | green "=============================" 754 | echo " " 755 | green " EdNovas " 756 | green " https://ednovas.xyz " 757 | echo " " 758 | green "=============================" 759 | echo " " 760 | yellow "当前版本(Version): $ver" 761 | yellow "更新(Updates): $changeLog" 762 | echo " " 763 | yellow "======检测到VPS信息如下======" 764 | green "ip地址:$getIpAddress" 765 | green "主机名:$hostnameVariable" 766 | green "处理器架构:$arch" 767 | green "虚拟化架构:$virt" 768 | green "操作系统:$release" 769 | green "内核版本:$kernelVer" 770 | echo " " 771 | echo "1. 修改登录为 root 密码登录" 772 | echo "2. VPS系统更新" 773 | echo "3. 甲骨文关闭防火墙" 774 | echo "4. Centos关闭防火墙" 775 | echo "5. Ubuntu/Debian关闭防火墙" 776 | echo "6. 关闭IPV6" 777 | echo "7. 打开IPV6" 778 | echo "8. 修改主机名" 779 | echo "9. 修改SSH连接端口" 780 | echo "10. 显示本机IP" 781 | echo "11. 显示实时进程" 782 | echo "12. 显示内存使用情况" 783 | echo "13. 显示磁盘占用" 784 | echo "14. 一键DD脚本" 785 | echo "15. 同步系统时间" 786 | echo "16. 修改系统DNS" 787 | echo "17. 一键添加SWAP" 788 | echo "18. Cloudflare DDNS解析" 789 | echo "19. IPV4优先" 790 | echo "20. IPV6优先" 791 | echo "21. 添加IPV6地址和网关" 792 | echo "22. 添加 DNS64 DNS解析" 793 | echo "0. 返回上一级" 794 | echo " " 795 | read -p "请输入选项:" partOneInput 796 | case "$partOneInput" in 797 | 1 ) rootLogin ;; 798 | 2 ) vpsupdate ;; 799 | 3 ) oraclefirewall ;; 800 | 4 ) centosfirewall ;; 801 | 5 ) ubuntufirewall ;; 802 | 6 ) closeipv6 ;; 803 | 7 ) openipv6 ;; 804 | 8 ) changehostname ;; 805 | 9 ) changesshport ;; 806 | 10 ) ipdetestonekey ;; 807 | 11 ) realTimeProgress ;; 808 | 12 ) memorySpace ;; 809 | 13 ) driveSpace ;; 810 | 14 ) ddonekey ;; 811 | 15 ) synctime ;; 812 | 16 ) changedns ;; 813 | 17 ) addswap ;; 814 | 18 ) cloudflareddns ;; 815 | 19 ) ipv4first ;; 816 | 20 ) ipv6first ;; 817 | 21 ) addipv6 ;; 818 | 22 ) addDNS64 ;; 819 | 0 ) start_menu ;; 820 | esac 821 | } 822 | 823 | 824 | 825 | # part 2 826 | function vpsPerformance(){ 827 | clear 828 | green "=============================" 829 | echo " " 830 | green " EdNovas " 831 | green " https://ednovas.xyz " 832 | echo " " 833 | green "=============================" 834 | echo " " 835 | yellow "当前版本(Version): $ver" 836 | yellow "更新(Updates): $changeLog" 837 | echo " " 838 | yellow "======检测到VPS信息如下======" 839 | green "ip地址:$getIpAddress" 840 | green "主机名:$hostnameVariable" 841 | green "处理器架构:$arch" 842 | green "虚拟化架构:$virt" 843 | green "操作系统:$release" 844 | green "内核版本:$kernelVer" 845 | echo " " 846 | echo "1. Bench VPS检测脚本" 847 | echo "2. SuperBench VPS检测脚本" 848 | echo "3. LemonBench VPS检测脚本" 849 | echo "4. yabs VPS检测脚本" 850 | echo "5. Speedtest-cli一键测速" 851 | echo "6. Speedtest-go网页测速搭建脚本" 852 | echo "7. 回程一键检测脚本" 853 | echo "8. 回程一键检测脚本简易版" 854 | echo "0. 返回上一级" 855 | echo " " 856 | read -p "请输入选项:" partTwoInput 857 | case "$partTwoInput" in 858 | 1 ) benchonekey ;; 859 | 2 ) superbench ;; 860 | 3 ) lemonbench ;; 861 | 4 ) yabs ;; 862 | 5 ) speedtest-clionekey ;; 863 | 6 ) speedtest-go ;; 864 | 7 ) routetrace ;; 865 | 8 ) routetracesimple ;; 866 | 0 ) start_menu ;; 867 | esac 868 | } 869 | 870 | 871 | # part 3 872 | function proxyRelated(){ 873 | clear 874 | green "=============================" 875 | echo " " 876 | green " EdNovas " 877 | green " https://ednovas.xyz " 878 | echo " " 879 | green "=============================" 880 | echo " " 881 | yellow "当前版本(Version): $ver" 882 | yellow "更新(Updates): $changeLog" 883 | echo " " 884 | yellow "======检测到VPS信息如下======" 885 | green "ip地址:$getIpAddress" 886 | green "主机名:$hostnameVariable" 887 | green "处理器架构:$arch" 888 | green "虚拟化架构:$virt" 889 | green "操作系统:$release" 890 | green "内核版本:$kernelVer" 891 | echo " " 892 | echo "1. Mack-a v2rayagent八合一脚本" 893 | echo "2. x-ui面板" 894 | echo "3. ssr一键脚本" 895 | echo "4. Xrayr 后端安装" 896 | echo "5. Soga一键安装" 897 | echo "6. Xrayr添加本地审计规则" 898 | echo "7. Mtproxy+伪tls一键脚本" 899 | echo "8. Surshark VPN一键安装脚本" 900 | echo "9. Express VPN一键安装脚本" 901 | echo "10. Wireguard一键安装脚本" 902 | echo "11. L2TP一键安装脚本" 903 | echo " " 904 | echo "12. TCP调优脚本" 905 | echo "13. 六合一BBR脚本" 906 | echo "14. OVZ开启BBR" 907 | echo "0. 返回上一级" 908 | echo " " 909 | read -p "请输入选项:" partThreeInput 910 | case "$partThreeInput" in 911 | 1 ) macka ;; 912 | 2 ) xui ;; 913 | 3 ) ssronekey ;; 914 | 4 ) xrayronekey ;; 915 | 5 ) sogaonekey ;; 916 | 6 ) rulelist ;; 917 | 7 ) mtproxyonekey ;; 918 | 8 ) sursharkinstall ;; 919 | 9 ) expressinstall ;; 920 | 10 ) wireguardonekey ;; 921 | 11 ) l2tponekey ;; 922 | 12 ) tcponekey ;; 923 | 13 ) bbronekey ;; 924 | 14 ) ovzbbr ;; 925 | 0 ) start_menu ;; 926 | esac 927 | } 928 | 929 | 930 | 931 | # part 4 932 | function mediaDetectionUnlock(){ 933 | clear 934 | green "=============================" 935 | echo " " 936 | green " EdNovas " 937 | green " https://ednovas.xyz " 938 | echo " " 939 | green "=============================" 940 | echo " " 941 | yellow "当前版本(Version): $ver" 942 | yellow "更新(Updates): $changeLog" 943 | echo " " 944 | yellow "======检测到VPS信息如下======" 945 | green "ip地址:$getIpAddress" 946 | green "主机名:$hostnameVariable" 947 | green "处理器架构:$arch" 948 | green "虚拟化架构:$virt" 949 | green "操作系统:$release" 950 | green "内核版本:$kernelVer" 951 | echo " " 952 | echo "1. 流媒体检测脚本" 953 | echo "2. 奈飞检测脚本" 954 | echo " " 955 | echo "3. fscarmen warp一键脚本" 956 | echo "4. fscarmen warp go一键脚本" 957 | echo "5. acacia233 warp解锁奈飞脚本" 958 | echo "6. GeorgeXie2333 warp解锁奈飞脚本" 959 | echo "7. GeorgeXie2333 warp刷IP脚本" 960 | echo "8. Tiktok区域检测脚本" 961 | echo "0. 返回上一级" 962 | echo " " 963 | read -p "请输入选项:" partFourInput 964 | case "$partFourInput" in 965 | 1 ) region ;; 966 | 2 ) netflixdetect ;; 967 | 3 ) warponekey ;; 968 | 4 ) warpgoonekey ;; 969 | 5 ) acacia233 ;; 970 | 6 ) georgexie2333onekey ;; 971 | 7 ) georgexie2333 ;; 972 | 8 ) tiktokcheck ;; 973 | 0 ) start_menu ;; 974 | esac 975 | } 976 | 977 | 978 | 979 | # part 5 980 | function forwardonekey(){ 981 | clear 982 | green "=============================" 983 | echo " " 984 | green " EdNovas " 985 | green " https://ednovas.xyz " 986 | echo " " 987 | green "=============================" 988 | echo " " 989 | yellow "当前版本(Version): $ver" 990 | yellow "更新(Updates): $changeLog" 991 | echo " " 992 | yellow "======检测到VPS信息如下======" 993 | green "ip地址:$getIpAddress" 994 | green "主机名:$hostnameVariable" 995 | green "处理器架构:$arch" 996 | green "虚拟化架构:$virt" 997 | green "操作系统:$release" 998 | green "内核版本:$kernelVer" 999 | echo " " 1000 | echo "1. Iptables转发脚本" 1001 | echo "2. Socat转发脚本" 1002 | echo "3. Gost加密脚本" 1003 | echo "4. Brook转发脚本" 1004 | echo "0. 返回上一级" 1005 | echo " " 1006 | read -p "请输入选项:" partFiveInput 1007 | case "$partFiveInput" in 1008 | 1 ) iptablesonekey ;; 1009 | 2 ) socatonekey ;; 1010 | 3 ) gostoneky ;; 1011 | 4 ) brookonekey ;; 1012 | 0 ) start_menu ;; 1013 | esac 1014 | } 1015 | 1016 | # part 6 1017 | function usefulTools(){ 1018 | clear 1019 | green "=============================" 1020 | echo " " 1021 | green " EdNovas " 1022 | green " https://ednovas.xyz " 1023 | echo " " 1024 | green "=============================" 1025 | echo " " 1026 | yellow "当前版本(Version): $ver" 1027 | yellow "更新(Updates): $changeLog" 1028 | echo " " 1029 | yellow "======检测到VPS信息如下======" 1030 | green "ip地址:$getIpAddress" 1031 | green "主机名:$hostnameVariable" 1032 | green "处理器架构:$arch" 1033 | green "虚拟化架构:$virt" 1034 | green "操作系统:$release" 1035 | green "内核版本:$kernelVer" 1036 | echo " " 1037 | echo "1. aapanel国际版宝塔安装" 1038 | echo "2. Docker一键脚本" 1039 | echo "3. Rclone官方一键脚本" 1040 | echo "4. Aria2一键脚本" 1041 | echo "5. Acme.sh一键申请证书" 1042 | echo "6. Screen后台运行管理脚本" 1043 | echo "7. 哪吒探针" 1044 | echo "0. 返回上一级" 1045 | echo " " 1046 | read -p "请输入选项:" partSixInput 1047 | case "$partSixInput" in 1048 | 1 ) aapanel ;; 1049 | 2 ) dockeronekey ;; 1050 | 3 ) rcloneonekey ;; 1051 | 4 ) aria2onekey ;; 1052 | 5 ) acmeonekey ;; 1053 | 6 ) screenonekey ;; 1054 | 7 ) nezha ;; 1055 | 0 ) start_menu ;; 1056 | esac 1057 | } 1058 | 1059 | # part 7 1060 | function interestingTools(){ 1061 | clear 1062 | green "=============================" 1063 | echo " " 1064 | green " EdNovas " 1065 | green " https://ednovas.xyz " 1066 | echo " " 1067 | green "=============================" 1068 | echo " " 1069 | yellow "当前版本(Version): $ver" 1070 | yellow "更新(Updates): $changeLog" 1071 | echo " " 1072 | yellow "======检测到VPS信息如下======" 1073 | green "ip地址:$getIpAddress" 1074 | green "主机名:$hostnameVariable" 1075 | green "处理器架构:$arch" 1076 | green "虚拟化架构:$virt" 1077 | green "操作系统:$release" 1078 | green "内核版本:$kernelVer" 1079 | echo " " 1080 | echo "1. cxxmatrix黑客帝国屏保" 1081 | echo "2. Teamspeak一键脚本v3.13.6" 1082 | echo "3. Epic Games自动领取每周免费游戏脚本" 1083 | echo "4. 青龙面板一键脚本" 1084 | echo "0. 返回上一级" 1085 | echo " " 1086 | read -p "请输入选项:" partSevenInput 1087 | case "$partSevenInput" in 1088 | 1 ) cxxmatrix ;; 1089 | 2 ) teamspeakonekey ;; 1090 | 3 ) epicgamesonekey ;; 1091 | 4 ) qinglongonekey ;; 1092 | 0 ) start_menu ;; 1093 | esac 1094 | } 1095 | 1096 | 1097 | 1098 | 1099 | # part 8 1100 | function othersonekey(){ 1101 | clear 1102 | green "=============================" 1103 | echo " " 1104 | green " EdNovas " 1105 | green " https://ednovas.xyz " 1106 | echo " " 1107 | green "=============================" 1108 | echo " " 1109 | yellow "当前版本(Version): $ver" 1110 | yellow "更新(Updates): $changeLog" 1111 | echo " " 1112 | yellow "======检测到VPS信息如下======" 1113 | green "ip地址:$getIpAddress" 1114 | green "主机名:$hostnameVariable" 1115 | green "处理器架构:$arch" 1116 | green "虚拟化架构:$virt" 1117 | green "操作系统:$release" 1118 | green "内核版本:$kernelVer" 1119 | echo " " 1120 | echo "1. 目前还没有哦,投稿可以联系 @ednovas" 1121 | echo "0. 返回上一级" 1122 | echo " " 1123 | read -p "请输入选项:" partSevenInput 1124 | case "$partSevenInput" in 1125 | 1 ) reallyNothing ;; 1126 | 0 ) start_menu ;; 1127 | * ) start_menu ;; 1128 | esac 1129 | } 1130 | 1131 | 1132 | #part 9 1133 | function updateScript(){ 1134 | wget -P /root -N https://cdn.jsdelivr.net/gh/ednovas/vpstoolbox@main/ednovastool.sh && chmod +x ednovastool.sh && ./ednovastool.sh 1135 | } 1136 | 1137 | 1138 | 1139 | function start_menu(){ 1140 | clear 1141 | green "=============================" 1142 | echo " " 1143 | green " EdNovas " 1144 | green " https://ednovas.xyz " 1145 | echo " " 1146 | green "=============================" 1147 | echo " " 1148 | yellow "当前版本(Version): $ver" 1149 | yellow "更新(Updates): $changeLog" 1150 | echo " " 1151 | yellow "======检测到VPS信息如下======" 1152 | green "ip地址:$getIpAddress" 1153 | green "主机名:$hostnameVariable" 1154 | green "处理器架构:$arch" 1155 | green "虚拟化架构:$virt" 1156 | green "操作系统:$release" 1157 | green "内核版本:$kernelVer" 1158 | echo " " 1159 | echo "1. VPS基本操作" 1160 | echo "2. VPS性能检测" 1161 | echo "3. 科学上网" 1162 | echo "4. 流媒体检测和解锁" 1163 | echo "5. 转发脚本" 1164 | echo "6. 常用软件" 1165 | echo "7. 有趣软件" 1166 | echo "8. 其他" 1167 | echo "9. 更新脚本" 1168 | echo "0. 退出脚本" 1169 | echo " " 1170 | echo "快捷方式创建成功,可执行[ednovas]快捷重新打开脚本" 1171 | read -p "请输入选项:" menuNumberInput 1172 | case "$menuNumberInput" in 1173 | 1 ) vpsBasic ;; 1174 | 2 ) vpsPerformance ;; 1175 | 3 ) proxyRelated ;; 1176 | 4 ) mediaDetectionUnlock ;; 1177 | 5 ) forwardonekey ;; 1178 | 6 ) usefulTools ;; 1179 | 7 ) interestingTools ;; 1180 | 8 ) othersonekey ;; 1181 | 9 ) updateScript ;; 1182 | 0 ) exit 0 ;; 1183 | esac 1184 | } 1185 | 1186 | Get_Ip_Address 1187 | mkdir -p /etc/ednovastool 1188 | aliasInstall 1189 | start_menu 1190 | -------------------------------------------------------------------------------- /root.sh: -------------------------------------------------------------------------------- 1 | green(){ 2 | echo -e "\033[32m\033[01m$1\033[0m" 3 | } 4 | 5 | red(){ 6 | echo -e "\033[31m\033[01m$1\033[0m" 7 | } 8 | 9 | yellow(){ 10 | echo -e "\033[33m\033[01m$1\033[0m" 11 | } 12 | 13 | sudo lsattr /etc/passwd /etc/shadow >/dev/null 2>&1 14 | sudo chattr -i /etc/passwd /etc/shadow >/dev/null 2>&1 15 | sudo chattr -a /etc/passwd /etc/shadow >/dev/null 2>&1 16 | sudo lsattr /etc/passwd /etc/shadow >/dev/null 2>&1 17 | 18 | green "VPS 允许 root 登录" 19 | green "VPS enable root login" 20 | read -p "请输入你的 root 账户密码 (Set your root password):" password 21 | echo root:$password | sudo chpasswd root 22 | sudo sed -i 's/^#\?PermitRootLogin.*/PermitRootLogin yes/g' /etc/ssh/sshd_config; 23 | sudo sed -i 's/^#\?PasswordAuthentication.*/PasswordAuthentication yes/g' /etc/ssh/sshd_config; 24 | sudo service sshd restart 25 | green "VPS 用户名: root" 26 | green "VPS 密码: $password" 27 | green "VPS username:root" 28 | green "VPS password:$password" 29 | yellow "如果出现'sudo:unable to resolve host'的提示可直接忽略" 30 | yellow "If 'sudo:unable to resolve host' shows, just ignore it" 31 | echo "Finished!" 32 | -------------------------------------------------------------------------------- /swap.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | #Blog:https://www.moerats.com/ 3 | 4 | Green="\033[32m" 5 | Font="\033[0m" 6 | Red="\033[31m" 7 | 8 | #root权限 9 | root_need(){ 10 | if [[ $EUID -ne 0 ]]; then 11 | echo -e "${Red}Error:This script must be run as root!${Font}" 12 | exit 1 13 | fi 14 | } 15 | 16 | #检测ovz 17 | ovz_no(){ 18 | if [[ -d "/proc/vz" ]]; then 19 | echo -e "${Red}Your VPS is based on OpenVZ,not supported!${Font}" 20 | exit 1 21 | fi 22 | } 23 | 24 | add_swap(){ 25 | echo -e "${Green}请输入需要添加的swap,建议为内存的2倍!${Font}" 26 | read -p "请输入swap数值:" swapsize 27 | 28 | #检查是否存在swapfile 29 | grep -q "swapfile" /etc/fstab 30 | 31 | #如果不存在将为其创建swap 32 | if [ $? -ne 0 ]; then 33 | echo -e "${Green}swapfile未发现,正在为其创建swapfile${Font}" 34 | fallocate -l ${swapsize}M /swapfile 35 | chmod 600 /swapfile 36 | mkswap /swapfile 37 | swapon /swapfile 38 | echo '/swapfile none swap defaults 0 0' >> /etc/fstab 39 | echo -e "${Green}swap创建成功,并查看信息:${Font}" 40 | cat /proc/swaps 41 | cat /proc/meminfo | grep Swap 42 | else 43 | echo -e "${Red}swapfile已存在,swap设置失败,请先运行脚本删除swap后重新设置!${Font}" 44 | fi 45 | } 46 | 47 | del_swap(){ 48 | #检查是否存在swapfile 49 | grep -q "swapfile" /etc/fstab 50 | 51 | #如果存在就将其移除 52 | if [ $? -eq 0 ]; then 53 | echo -e "${Green}swapfile已发现,正在将其移除...${Font}" 54 | sed -i '/swapfile/d' /etc/fstab 55 | echo "3" > /proc/sys/vm/drop_caches 56 | swapoff -a 57 | rm -f /swapfile 58 | echo -e "${Green}swap已删除!${Font}" 59 | else 60 | echo -e "${Red}swapfile未发现,swap删除失败!${Font}" 61 | fi 62 | } 63 | 64 | #开始菜单 65 | main(){ 66 | root_need 67 | ovz_no 68 | clear 69 | echo -e "———————————————————————————————————————" 70 | echo -e "${Green}Linux VPS一键添加/删除swap脚本${Font}" 71 | echo -e "${Green}1、添加swap${Font}" 72 | echo -e "${Green}2、删除swap${Font}" 73 | echo -e "———————————————————————————————————————" 74 | read -p "请输入数字 [1-2]:" num 75 | case "$num" in 76 | 1) 77 | add_swap 78 | ;; 79 | 2) 80 | del_swap 81 | ;; 82 | *) 83 | clear 84 | echo -e "${Green}请输入正确数字 [1-2]${Font}" 85 | sleep 2s 86 | main 87 | ;; 88 | esac 89 | } 90 | main 91 | --------------------------------------------------------------------------------