From 74580eace276529c059ba34095d43ddf56e86805 Mon Sep 17 00:00:00 2001 From: Evgeny Nerush Date: Thu, 25 Jan 2024 16:14:37 +0300 Subject: [PATCH] fix link command if conf not found --- ex.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ex.sh b/ex.sh index 419496d..a6e83c9 100755 --- a/ex.sh +++ b/ex.sh @@ -537,6 +537,12 @@ then echo -e "${red}no config is given${normal}" exit 1 fi + if [ ! -f $conf_file ] + then + echo -e "${red}file ${conf_file} does not exist${normal}" + exit 1 + fi + check_command jq "needed for operations with configs" id=$(strip_quotes $(jq ".outbounds[0].settings.vnext[0].users[0].id" $conf_file)) address=$(strip_quotes $(jq ".outbounds[0].settings.vnext[0].address" $conf_file)) port=$(jq ".outbounds[0].settings.vnext[0].port" $conf_file) @@ -544,7 +550,7 @@ then server_name=$(strip_quotes $(jq ".outbounds[0].streamSettings.realitySettings.serverName" $conf_file)) short_id=$(strip_quotes $(jq ".outbounds[0].streamSettings.realitySettings.shortId" $conf_file)) link="vless://${id}@${address}:${port}?fragment=&security=reality&encryption=none&pbk=${public_key}&fp=chrome&type=tcp&flow=xtls-rprx-vision&sni=${server_name}&sid=${short_id}#easy-xray+%F0%9F%97%BD" - echo -e "${yellow}don't forget to share misc/customgeo4hiddify.txt as well + echo -e "${yellow}don't forget to share misc/customgeo4hiddify.txt or misc/customgeo4nekoray.txt as well ${green}here is your link:${normal}" echo $link