From 433e5fff3344144c184992797d5d738645eb1b98 Mon Sep 17 00:00:00 2001 From: KANIKIG Date: Tue, 1 Dec 2020 10:35:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=88=A0=E9=99=A4=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E6=97=B6=E4=B8=8D=E8=BE=93=E5=85=A5=E6=95=B0=E5=AD=97?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E5=88=A0=E9=99=A4=E5=85=A8=E9=83=A8=E8=BD=AC?= =?UTF-8?q?=E5=8F=91=E7=9A=84BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gost.sh | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/gost.sh b/gost.sh index 3327fbb..4f7e1aa 100755 --- a/gost.sh +++ b/gost.sh @@ -529,13 +529,17 @@ case "$num" in 9) show_all_conf read -p "请输入你要删除的配置编号:" numdelete - sed -i "${numdelete}d" $raw_conf_path - rm -rf /etc/gost/config.json - confstart - writeconf - conflast - systemctl restart gost - echo -e "配置已删除,服务已重启" + if $numdelete | grep -q '[^0-9]'; then + echo "请输入正确数字" + else + sed -i "${numdelete}d" $raw_conf_path + rm -rf /etc/gost/config.json + confstart + writeconf + conflast + systemctl restart gost + echo -e "配置已删除,服务已重启" + fi ;; *) echo "请输入正确数字 [1-9]"