2018-12-31

This commit is contained in:
monlor
2018-12-31 23:47:47 +08:00
commit 3ae56f5e6e
1091 changed files with 173538 additions and 0 deletions

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,27 @@
#------------------【SSServer】--------------------
ssserver() {
eval `mbdb export ssserver`
source /etc/mixbox/bin/base
echo "********* $service ***********"
echo "[${appinfo}]"
readsh "启动${appname}服务[1/0] " "enable" "1"
if [ "$enable" == '1' ]; then
# Scripts Here
read -p "修改${appname}配置信息?[1/0] " res
if [ "$res" = '1' ]; then
ciphers="aes-256-gcm aes-192-gcm aes-128-gcm aes-256-ctr aes-192-ctr aes-128-ctr aes-256-cfb aes-192-cfb aes-128-cfb camellia-128-cfb camellia-192-cfb camellia-256-cfb xchacha20-ietf-poly1305 chacha20-ietf-poly1305 chacha20-ietf chacha20 salsa20 rc4-md5"
readsh "请输入${appname}端口号" "port" "1020"
readsh "请输入${appname}密码" "password" "tools"
echo $ciphers | tr " " "\n" | grep -n . | sed -e "s/:/) /g"
readsh "请输入${appname}加密方式(勿输入数字)" "method" "chacha20"
fi
readsh "请输入${appname}外网访问配置[1/0]" "openport" "1"
${mbroot}/apps/${appname}/scripts/${appname}.sh restart
else
${mbroot}/apps/${appname}/scripts/${appname}.sh stop
fi
}
#------------------【SSServer】--------------------

View File

@@ -0,0 +1,8 @@
service="SSServer"
appname="ssserver"
needver="0.0.1"
backupfiles=""
supports="linux_arm,linux_x86_64"
appinfo="快速搭建ss服务端程序"
newinfo=""
version="0.0.2"

View File

@@ -0,0 +1 @@
1.0.0

View File

@@ -0,0 +1,75 @@
#!/bin/sh
source /etc/mixbox/bin/base
eval `mbdb export ssserver`
binname="shadowsocks-libev"
start() {
[ -n "$(pidof ss-server)" ] && logsh "$service" "${appname}已经在运行!" && exit 1
logsh "$service" "正在启动${appname}服务... "
# cru a "${appname}" "0 6 * * * ${mbroot}/apps/${appname}/scripts/${appname}.sh restart"
# Scripts Here
cat > ${mbroot}/apps/${appname}/config/ss.json <<-EOF
{
"server":"0.0.0.0",
"server_port":${port},
"password":"$password",
"timeout":300,
"user":"nobody",
"method":"$method",
"nameserver":"223.5.5.5",
"mode":"tcp_and_udp"
}
EOF
open_port
write_firewall_start
daemon ${mbroot}/apps/${appname}/bin/ss-server -c ${mbroot}/apps/${appname}/config/ss.json
logsh "$service" "启动${appname}服务完成!"
}
stop() {
logsh "$service" "正在停止${appname}服务... "
[ "$enable" == '0' ] && destroy
close_port
remove_firewall_start
kill -9 "$(pidof ss-server)" &> /dev/null
}
destroy() {
# End app, Scripts here
# cru d "${appname}"
return
}
end() {
mbdb set $appname.main.enable=0
stop && exit 1
}
status() {
if [ -n "$(pidof ss-server)" ]; then
status="运行端口号:${port}|1"
else
status="未运行|0"
fi
mbdb set ${appname}.main.status="$status"
}
case "$1" in
start) start ;;
stop) stop ;;
restart) stop; start ;;
reload) close_port && open_port ;;
status) status ;;
esac