Update serv00keep.sh

This commit is contained in:
甬哥侃侃侃ygkkk
2025-02-18 21:57:10 +08:00
committed by GitHub
parent c0cd9ef7c2
commit a8596c97f9
+15 -15
View File
@@ -24,21 +24,6 @@ export resport=${resport:-''}
USERNAME=$(whoami | tr '[:upper:]' '[:lower:]')
HOSTNAME=$(hostname)
if [[ "$resport" =~ ^[Yy]$ ]]; then
portlist=$(devil port list | grep -E '^[0-9]+[[:space:]]+[a-zA-Z]+' | sed 's/^[[:space:]]*//')
if [[ -z "$portlist" ]]; then
yellow "无端口"
else
while read -r line; do
port=$(echo "$line" | awk '{print $1}')
port_type=$(echo "$line" | awk '{print $2}')
yellow "删除端口 $port ($port_type)"
devil port del "$port_type" "$port"
done <<< "$portlist"
fi
check_port
fi
if [[ "$reset" =~ ^[Yy]$ ]]; then
#crontab -l | grep -v "serv00keep" >rmcron
#crontab rmcron >/dev/null 2>&1
@@ -60,6 +45,21 @@ FILE_PATH="${HOME}/domains/${USERNAME}.serv00.net/public_html"
WORKDIR="${HOME}/domains/${USERNAME}.serv00.net/logs"
[ -d "$WORKDIR" ] || (mkdir -p "$WORKDIR" && chmod 777 "$WORKDIR")
if [[ "$resport" =~ ^[Yy]$ ]]; then
portlist=$(devil port list | grep -E '^[0-9]+[[:space:]]+[a-zA-Z]+' | sed 's/^[[:space:]]*//')
if [[ -z "$portlist" ]]; then
yellow "无端口"
else
while read -r line; do
port=$(echo "$line" | awk '{print $1}')
port_type=$(echo "$line" | awk '{print $2}')
yellow "删除端口 $port ($port_type)"
devil port del "$port_type" "$port"
done <<< "$portlist"
fi
check_port
fi
read_ip(){
nb=$(echo "$HOSTNAME" | cut -d '.' -f 1 | tr -d 's')
ym=("$HOSTNAME" "cache$nb.serv00.com" "web$nb.serv00.com")