diff options
Diffstat (limited to '.local/bin/singboxwrap')
| -rwxr-xr-x | .local/bin/singboxwrap | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/.local/bin/singboxwrap b/.local/bin/singboxwrap index a69bbc4..2ef4081 100755 --- a/.local/bin/singboxwrap +++ b/.local/bin/singboxwrap @@ -6,6 +6,7 @@ default_path="${XDG_DATA_HOME:-$HOME/.local/share}/singboxcfg" input=$1 run_singbox () { + [ -z "${1}" ] && exit sing-box check -c "$1" && { pidof sing-box >/dev/null && killall sing-box setsid -f sing-box -c "$1" run @@ -17,7 +18,7 @@ run_singbox () { choose_menu () { choose="$(fd . $config_dir -d 1 -t f | rofi -dmenu -no-custom -p "Config to use")" - [ -n "$choose" ] || exit 1 + [ -z "${choose}" ] && exit ln -sf "$choose" "$default_path" echo "$default_path" } |