shell scripts : add commas to SCRIPT,EXEDIR

This commit is contained in:
bolvan 2019-05-08 09:56:46 +03:00
parent cc944603bb
commit d0cd265730
10 changed files with 25 additions and 24 deletions

View File

@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
SCRIPT=$(readlink -f $0) SCRIPT=$(readlink -f "$0")
EXEDIR=$(dirname $SCRIPT) EXEDIR=$(dirname "$SCRIPT")
BINS=binaries BINS=binaries
BINDIR=$EXEDIR/$BINS BINDIR=$EXEDIR/$BINS

View File

@ -2,8 +2,8 @@
# automated script for easy installing zapret # automated script for easy installing zapret
SCRIPT=$(readlink -f $0) SCRIPT=$(readlink -f "$0")
EXEDIR=$(dirname $SCRIPT) EXEDIR=$(dirname "$SCRIPT")
ZAPRET_BASE=/opt/zapret ZAPRET_BASE=/opt/zapret
ZAPRET_CONFIG=$EXEDIR/config ZAPRET_CONFIG=$EXEDIR/config
@ -34,8 +34,8 @@ exitp()
[ $(id -u) -ne "0" ] && { [ $(id -u) -ne "0" ] && {
echo root is required echo root is required
exists sudo && exec sudo $0 exists sudo && exec sudo "$0"
exists su && exec su -c $0 exists su && exec su -c "$0"
echo su or sudo not found echo su or sudo not found
exitp 2 exitp 2
} }
@ -146,6 +146,7 @@ ask_list()
write_config_var() write_config_var()
{ {
# $1 - mode var # $1 - mode var
local M
eval M="\$$1" eval M="\$$1"
if [ -n "$M" ]; then if [ -n "$M" ]; then

View File

@ -1,8 +1,8 @@
#!/bin/sh #!/bin/sh
# create ipset from resolved ip's # create ipset from resolved ip's
SCRIPT=$(readlink -f $0) SCRIPT=$(readlink -f "$0")
EXEDIR=$(dirname $SCRIPT) EXEDIR=$(dirname "$SCRIPT")
IPSET_OPT="hashsize 131072 maxelem 524288" IPSET_OPT="hashsize 131072 maxelem 524288"
IP2NET=$EXEDIR/../ip2net/ip2net IP2NET=$EXEDIR/../ip2net/ip2net

View File

@ -1,8 +1,8 @@
#!/bin/sh #!/bin/sh
# get ip list from antizapret.prostovpn.org # get ip list from antizapret.prostovpn.org
SCRIPT=$(readlink -f $0) SCRIPT=$(readlink -f "$0")
EXEDIR=$(dirname $SCRIPT) EXEDIR=$(dirname "$SCRIPT")
. "$EXEDIR/def.sh" . "$EXEDIR/def.sh"

View File

@ -1,8 +1,8 @@
#!/bin/sh #!/bin/sh
# get rublacklist and resolve it # get rublacklist and resolve it
SCRIPT=$(readlink -f $0) SCRIPT=$(readlink -f "$0")
EXEDIR=$(dirname $SCRIPT) EXEDIR=$(dirname "$SCRIPT")
. "$EXEDIR/def.sh" . "$EXEDIR/def.sh"

View File

@ -1,8 +1,8 @@
#!/bin/sh #!/bin/sh
# run script specified in config # run script specified in config
SCRIPT=$(readlink -f $0) SCRIPT=$(readlink -f "$0")
EXEDIR=$(dirname $SCRIPT) EXEDIR=$(dirname "$SCRIPT")
. "$EXEDIR/../config" . "$EXEDIR/../config"

View File

@ -1,8 +1,8 @@
#!/bin/sh #!/bin/sh
# get domain list. not IP # get domain list. not IP
SCRIPT=$(readlink -f $0) SCRIPT=$(readlink -f "$0")
EXEDIR=$(dirname $SCRIPT) EXEDIR=$(dirname "$SCRIPT")
. "$EXEDIR/def.sh" . "$EXEDIR/def.sh"

View File

@ -1,8 +1,8 @@
#!/bin/sh #!/bin/sh
# get rublacklist and resolve it # get rublacklist and resolve it
SCRIPT=$(readlink -f $0) SCRIPT=$(readlink -f "$0")
EXEDIR=$(dirname $SCRIPT) EXEDIR=$(dirname "$SCRIPT")
. "$EXEDIR/def.sh" . "$EXEDIR/def.sh"

View File

@ -1,8 +1,8 @@
#!/bin/sh #!/bin/sh
# resolve user host list # resolve user host list
SCRIPT=$(readlink -f $0) SCRIPT=$(readlink -f "$0")
EXEDIR=$(dirname $SCRIPT) EXEDIR=$(dirname "$SCRIPT")
. "$EXEDIR/def.sh" . "$EXEDIR/def.sh"

View File

@ -2,8 +2,8 @@
# automated script for easy uninstalling zapret # automated script for easy uninstalling zapret
SCRIPT=$(readlink -f $0) SCRIPT=$(readlink -f "$0")
EXEDIR=$(dirname $SCRIPT) EXEDIR=$(dirname "$SCRIPT")
GET_IPLIST_PREFIX=/ipset/get_ GET_IPLIST_PREFIX=/ipset/get_
exists() exists()
@ -25,8 +25,8 @@ exitp()
[ $(id -u) -ne "0" ] && { [ $(id -u) -ne "0" ] && {
echo root is required echo root is required
exists sudo && exec sudo $0 exists sudo && exec sudo "$0"
exists su && exec su -c $0 exists su && exec su -c "$0"
echo su or sudo not found echo su or sudo not found
exitp 2 exitp 2
} }