Skip to content

Commit

Permalink
修复删除配置时不输入数字默认删除全部转发的BUG
Browse files Browse the repository at this point in the history
  • Loading branch information
KANIKIG committed Dec 1, 2020
1 parent 69882a1 commit 433e5ff
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions gost.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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]"
Expand Down

0 comments on commit 433e5ff

Please sign in to comment.