style: format code

This commit is contained in:
Sofia
2026-01-15 15:35:19 +08:00
committed by GitHub
parent 281595f79f
commit a5668dd94b

View File

@@ -525,13 +525,13 @@ testcommand(){
netstat -ntulp | grep 53 netstat -ntulp | grep 53
echo "-----------------------------------------------" echo "-----------------------------------------------"
echo -e "可以使用\033[44m netstat -ntulp |grep xxx \033[0m来查询任意(xxx)端口" echo -e "可以使用\033[44m netstat -ntulp |grep xxx \033[0m来查询任意(xxx)端口"
exit; exit
;; ;;
3) 3)
echo "-----------------------------------------------" echo "-----------------------------------------------"
openssl speed -multi 4 -evp aes-128-gcm openssl speed -multi 4 -evp aes-128-gcm
echo "-----------------------------------------------" echo "-----------------------------------------------"
exit; exit
;; ;;
4) 4)
if [ "$firewall_mod" = "nftables" ]; then if [ "$firewall_mod" = "nftables" ]; then
@@ -582,20 +582,26 @@ testcommand(){
echo "----------------本机防火墙---------------------" echo "----------------本机防火墙---------------------"
iptables -L INPUT --line-numbers iptables -L INPUT --line-numbers
fi fi
exit; exit
;; ;;
5) 5)
echo "-----------------------------------------------" echo "-----------------------------------------------"
sed -n '1,40p' ${config_path} sed -n '1,40p' ${config_path}
echo "-----------------------------------------------" echo "-----------------------------------------------"
exit; exit
;; ;;
6) 6)
echo "注意依赖curl(不支持wget),且测试结果不保证一定准确!" echo "注意依赖curl(不支持wget),且测试结果不保证一定准确!"
delay=`curl -kx ${authentication}@127.0.0.1:$mix_port -o /dev/null -s -w '%{time_starttransfer}' 'https://google.tw' & { sleep 3 ; kill $! >/dev/null 2>&1 & }` > /dev/null 2>&1 delay=$(
delay=`echo |awk "{print $delay*1000}"` > /dev/null 2>&1 curl -kx ${authentication}@127.0.0.1:$mix_port -o /dev/null -s -w '%{time_starttransfer}' 'https://google.tw' &
{
sleep 3
kill $! >/dev/null 2>&1 &
}
) >/dev/null 2>&1
delay=$(echo | awk "{print $delay*1000}") >/dev/null 2>&1
echo "-----------------------------------------------" echo "-----------------------------------------------"
if [ `echo ${#delay}` -gt 1 ];then if [ $(echo ${#delay}) -gt 1 ]; then
echo -e "\033[32m连接成功响应时间为"$delay" ms\033[0m" echo -e "\033[32m连接成功响应时间为"$delay" ms\033[0m"
else else
echo -e "\033[31m连接超时请重试或检查节点配置\033[0m" echo -e "\033[31m连接超时请重试或检查节点配置\033[0m"
@@ -608,6 +614,7 @@ testcommand(){
;; ;;
esac esac
} }
debug() { debug() {
echo "$crashcore" | grep -q 'singbox' && config_tmp="$TMPDIR"/jsons || config_tmp="$TMPDIR"/config.yaml echo "$crashcore" | grep -q 'singbox' && config_tmp="$TMPDIR"/jsons || config_tmp="$TMPDIR"/config.yaml
echo "-----------------------------------------------" echo "-----------------------------------------------"
@@ -635,7 +642,10 @@ debug(){
"$CRASHDIR"/start.sh bfstart "$CRASHDIR"/start.sh bfstart
if echo "$crashcore" | grep -q 'singbox'; then if echo "$crashcore" | grep -q 'singbox'; then
"$TMPDIR"/CrashCore run -D "$BINDIR" -C "$TMPDIR"/jsons & "$TMPDIR"/CrashCore run -D "$BINDIR" -C "$TMPDIR"/jsons &
{ sleep 4 ; kill $! >/dev/null 2>&1 & } {
sleep 4
kill $! >/dev/null 2>&1 &
}
wait wait
else else
"$TMPDIR"/CrashCore -t -d "$BINDIR" -f "$TMPDIR"/config.yaml "$TMPDIR"/CrashCore -t -d "$BINDIR" -f "$TMPDIR"/config.yaml
@@ -684,4 +694,3 @@ debug(){
;; ;;
esac esac
} }