mirror of
https://github.com/juewuy/ShellCrash.git
synced 2026-03-10 23:41:22 +00:00
~优化菜单结构
This commit is contained in:
@@ -1,3 +1,11 @@
|
||||
用于存放脚本内置工具的脚本
|
||||
|
||||
此处脚本内容不应包含非报错的文字输出和log输出
|
||||
引用方式必须为:
|
||||
|
||||
```shell
|
||||
. "$CRASHDIR"/libs/xxx.sh
|
||||
```
|
||||
|
||||
返回码必须是return x而不能是exit x
|
||||
|
||||
此处脚本内容不应包含文字输出和log输出
|
||||
@@ -1,17 +0,0 @@
|
||||
#!/bin/sh
|
||||
# Copyright (C) Juewuy
|
||||
|
||||
|
||||
if [ $1 -gt 65535 -o $1 -le 1 ]; then
|
||||
echo -e "\033[31m输入错误!请输入正确的数值(1-65535)!\033[0m"
|
||||
exit 1
|
||||
elif [ -n "$(echo "|$mix_port|$redir_port|$dns_port|$db_port|" | grep "|$1|")" ]; then
|
||||
echo -e "\033[31m输入错误!请不要输入重复的端口!\033[0m"
|
||||
exit 1
|
||||
elif [ -n "$(netstat -ntul | grep ":$1 ")" ]; then
|
||||
echo -e "\033[31m当前端口已被其他进程占用,请重新输入!\033[0m"
|
||||
exit 1
|
||||
else
|
||||
exit 0
|
||||
fi
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
#!/bin/sh
|
||||
# Copyright (C) Juewuy
|
||||
|
||||
[ "$wg_service" = ON ] && {
|
||||
cat >>"$TMPDIR"/proxies.yaml <<EOF
|
||||
- name: "wg"
|
||||
type: wireguard
|
||||
private-key: $wg_private_key
|
||||
server: $wg_server
|
||||
port: $wg_port
|
||||
ip: $wg_ipv4
|
||||
ipv6: $wg_ipv6
|
||||
public-key: $wg_public_key
|
||||
allowed-ips: ['0.0.0.0/0', '::/0']
|
||||
pre-shared-key: $wg_pre_shared_key
|
||||
mtu: 1420
|
||||
udp: true
|
||||
EOF
|
||||
}
|
||||
Reference in New Issue
Block a user