Skip to content

Commit dd0b56b

Browse files
authored
Suppress crontab command output
Redirect crontab command output to /dev/null to suppress messages.
1 parent 62d6b9c commit dd0b56b

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

install.sh

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ check_status
401401
if [[ $? == 1 ]]; then
402402
crontab -l 2>/dev/null > /tmp/crontab.tmp
403403
sed -i '/goxui.sh/d' /tmp/crontab.tmp
404-
crontab /tmp/crontab.tmp
404+
crontab /tmp/crontab.tmp >/dev/null 2>&1
405405
rm /tmp/crontab.tmp
406406
green "x-ui停止成功"
407407
else
@@ -421,11 +421,11 @@ check_status
421421
if [[ $? == 0 ]]; then
422422
crontab -l 2>/dev/null > /tmp/crontab.tmp
423423
sed -i '/goxui.sh/d' /tmp/crontab.tmp
424-
crontab /tmp/crontab.tmp
424+
crontab /tmp/crontab.tmp >/dev/null 2>&1
425425
rm /tmp/crontab.tmp
426426
crontab -l 2>/dev/null > /tmp/crontab.tmp
427427
echo "* * * * * /usr/local/x-ui/goxui.sh" >> /tmp/crontab.tmp
428-
crontab /tmp/crontab.tmp
428+
crontab /tmp/crontab.tmp >/dev/null 2>&1
429429
rm /tmp/crontab.tmp
430430
green "x-ui重启成功"
431431
else
@@ -635,7 +635,7 @@ uncronxui
635635
crontab -l 2>/dev/null > /tmp/crontab.tmp
636636
echo "* * * * * /usr/local/x-ui/goxui.sh" >> /tmp/crontab.tmp
637637
echo "0 2 * * * systemctl restart x-ui" >> /tmp/crontab.tmp
638-
crontab /tmp/crontab.tmp
638+
crontab /tmp/crontab.tmp >/dev/null 2>&1
639639
rm /tmp/crontab.tmp
640640
}
641641

@@ -647,7 +647,7 @@ sed -i '/xuiargoport.log/d' /tmp/crontab.tmp
647647
sed -i '/xuiargopid.log/d' /tmp/crontab.tmp
648648
sed -i '/xuiargoympid/d' /tmp/crontab.tmp
649649
sed -i '/xuiwpphid.log/d' /tmp/crontab.tmp
650-
crontab /tmp/crontab.tmp
650+
crontab /tmp/crontab.tmp >/dev/null 2>&1
651651
rm /tmp/crontab.tmp
652652
}
653653

@@ -816,18 +816,18 @@ fi
816816
done
817817
crontab -l 2>/dev/null > /tmp/crontab.tmp
818818
sed -i '/xuiargoport.log/d' /tmp/crontab.tmp
819-
crontab /tmp/crontab.tmp
819+
crontab /tmp/crontab.tmp >/dev/null 2>&1
820820
rm /tmp/crontab.tmp
821821
crontab -l 2>/dev/null > /tmp/crontab.tmp
822822
echo '@reboot /bin/bash -c "/usr/local/x-ui/cloudflared tunnel --url http://localhost:$(cat /usr/local/x-ui/xuiargoport.log) --edge-ip-version auto --no-autoupdate --protocol http2 > /usr/local/x-ui/argo.log 2>&1 & pid=\$! && echo \$pid > /usr/local/x-ui/xuiargopid.log"' >> /tmp/crontab.tmp
823-
crontab /tmp/crontab.tmp
823+
crontab /tmp/crontab.tmp >/dev/null 2>&1
824824
rm /tmp/crontab.tmp
825825
elif [ "$menu" = "2" ]; then
826826
kill -15 $(cat /usr/local/x-ui/xuiargopid.log 2>/dev/null) >/dev/null 2>&1
827827
rm -rf /usr/local/x-ui/argo.log /usr/local/x-ui/xuiargopid.log /usr/local/x-ui/xuiargoport.log
828828
crontab -l 2>/dev/null > /tmp/crontab.tmp
829829
sed -i '/xuiargopid.log/d' /tmp/crontab.tmp
830-
crontab /tmp/crontab.tmp
830+
crontab /tmp/crontab.tmp >/dev/null 2>&1
831831
rm /tmp/crontab.tmp
832832
green "已卸载Argo临时隧道"
833833
else
@@ -866,7 +866,7 @@ echo ${argotoken} > /usr/local/x-ui/xuiargotoken.log
866866
crontab -l 2>/dev/null > /tmp/crontab.tmp
867867
sed -i '/xuiargoympid/d' /tmp/crontab.tmp
868868
echo '@reboot /bin/bash -c "nohup setsid /usr/local/x-ui/cloudflared tunnel --no-autoupdate --edge-ip-version auto --protocol http2 run --token $(cat /usr/local/x-ui/xuiargotoken.log 2>/dev/null) >/dev/null 2>&1 & pid=\$! && echo \$pid > /usr/local/x-ui/xuiargoympid.log"' >> /tmp/crontab.tmp
869-
crontab /tmp/crontab.tmp
869+
crontab /tmp/crontab.tmp >/dev/null 2>&1
870870
rm /tmp/crontab.tmp
871871
argo=$(cat /usr/local/x-ui/xuiargoym.log 2>/dev/null)
872872
blue "Argo固定隧道设置完成,固定域名:$argo"
@@ -875,7 +875,7 @@ kill -15 $(cat /usr/local/x-ui/xuiargoympid.log 2>/dev/null) >/dev/null 2>&1
875875
rm -rf /usr/local/x-ui/xuiargoym.log /usr/local/x-ui/xuiargoymport.log /usr/local/x-ui/xuiargoympid.log /usr/local/x-ui/xuiargotoken.log
876876
crontab -l 2>/dev/null > /tmp/crontab.tmp
877877
sed -i '/xuiargoympid/d' /tmp/crontab.tmp
878-
crontab /tmp/crontab.tmp
878+
crontab /tmp/crontab.tmp >/dev/null 2>&1
879879
rm /tmp/crontab.tmp
880880
green "已卸载Argo固定隧道"
881881
else
@@ -2389,7 +2389,7 @@ kill -15 $(cat /usr/local/x-ui/xuiwpphid.log 2>/dev/null) >/dev/null 2>&1
23892389
rm -rf /usr/local/x-ui/xuiwpph.log /usr/local/x-ui/xuiwpphid.log
23902390
crontab -l 2>/dev/null > /tmp/crontab.tmp
23912391
sed -i '/xuiwpphid.log/d' /tmp/crontab.tmp
2392-
crontab /tmp/crontab.tmp
2392+
crontab /tmp/crontab.tmp >/dev/null 2>&1
23932393
rm /tmp/crontab.tmp
23942394
}
23952395
echo
@@ -2411,7 +2411,7 @@ echo "/usr/local/x-ui/xuiwpph -b 127.0.0.1:$port --gool -$sw46 --endpoint 162.15
24112411
crontab -l 2>/dev/null > /tmp/crontab.tmp
24122412
sed -i '/xuiwpphid.log/d' /tmp/crontab.tmp
24132413
echo '@reboot /bin/bash -c "nohup setsid $(cat /usr/local/x-ui/xuiwpph.log 2>/dev/null) & pid=\$! && echo \$pid > /usr/local/x-ui/xuiwpphid.log"' >> /tmp/crontab.tmp
2414-
crontab /tmp/crontab.tmp
2414+
crontab /tmp/crontab.tmp >/dev/null 2>&1
24152415
rm /tmp/crontab.tmp
24162416
green "WARP-plus-Socks5的IP获取成功,可进行Socks5代理分流"
24172417
fi
@@ -2463,7 +2463,7 @@ echo "/usr/local/x-ui/xuiwpph -b 127.0.0.1:$port --cfon --country $guojia -$sw46
24632463
crontab -l 2>/dev/null > /tmp/crontab.tmp
24642464
sed -i '/xuiwpphid.log/d' /tmp/crontab.tmp
24652465
echo '@reboot /bin/bash -c "nohup setsid $(cat /usr/local/x-ui/xuiwpph.log 2>/dev/null) & pid=\$! && echo \$pid > /usr/local/x-ui/xuiwpphid.log"' >> /tmp/crontab.tmp
2466-
crontab /tmp/crontab.tmp
2466+
crontab /tmp/crontab.tmp >/dev/null 2>&1
24672467
rm /tmp/crontab.tmp
24682468
green "WARP-plus-Socks5的IP获取成功,可进行Socks5代理分流"
24692469
fi

0 commit comments

Comments
 (0)