mirror of
https://github.com/bol-van/zapret.git
synced 2024-11-29 21:40:52 +03:00
scripts: add quotes to paths
This commit is contained in:
parent
6276d92ffb
commit
15751976e0
@ -154,7 +154,7 @@ linux_get_subsys()
|
|||||||
local INIT="$(sed 's/\x0/\n/g' /proc/1/cmdline | head -n 1)"
|
local INIT="$(sed 's/\x0/\n/g' /proc/1/cmdline | head -n 1)"
|
||||||
|
|
||||||
[ -L "$INIT" ] && INIT=$(readlink "$INIT")
|
[ -L "$INIT" ] && INIT=$(readlink "$INIT")
|
||||||
INIT=$(basename "$INIT")
|
INIT="$(basename "$INIT")"
|
||||||
if [ -f "/etc/openwrt_release" ] && [ "$INIT" = "procd" ] ; then
|
if [ -f "/etc/openwrt_release" ] && [ "$INIT" = "procd" ] ; then
|
||||||
SUBSYS=openwrt
|
SUBSYS=openwrt
|
||||||
elif [ -x "/bin/ndm" ] ; then
|
elif [ -x "/bin/ndm" ] ; then
|
||||||
|
@ -89,7 +89,7 @@ check_system()
|
|||||||
# do not use 'exe' because it requires root
|
# do not use 'exe' because it requires root
|
||||||
local INIT="$(sed 's/\x0/\n/g' /proc/1/cmdline | head -n 1)"
|
local INIT="$(sed 's/\x0/\n/g' /proc/1/cmdline | head -n 1)"
|
||||||
[ -L "$INIT" ] && INIT=$(readlink "$INIT")
|
[ -L "$INIT" ] && INIT=$(readlink "$INIT")
|
||||||
INIT=$(basename "$INIT")
|
INIT="$(basename "$INIT")"
|
||||||
# some distros include systemctl without systemd
|
# some distros include systemctl without systemd
|
||||||
if [ -d "$SYSTEMD_DIR" ] && [ -x "$SYSTEMCTL" ] && [ "$INIT" = "systemd" ]; then
|
if [ -d "$SYSTEMD_DIR" ] && [ -x "$SYSTEMCTL" ] && [ "$INIT" = "systemd" ]; then
|
||||||
SYSTEM=systemd
|
SYSTEM=systemd
|
||||||
|
@ -117,7 +117,7 @@ resolve_lower_devices()
|
|||||||
{
|
{
|
||||||
local l lower lowers
|
local l lower lowers
|
||||||
while read lower; do
|
while read lower; do
|
||||||
lower=$(basename "$lower")
|
lower="$(basename "$lower")"
|
||||||
l="${lower#lower_*}"
|
l="${lower#lower_*}"
|
||||||
[ "$l" != "$lower" ] && append_separator_list lowers ' ' '' "$l"
|
[ "$l" != "$lower" ] && append_separator_list lowers ' ' '' "$l"
|
||||||
done
|
done
|
||||||
|
@ -41,7 +41,7 @@ check_dir()
|
|||||||
# link or copy executables. uncomment either ln or cp, comment other
|
# link or copy executables. uncomment either ln or cp, comment other
|
||||||
ccp()
|
ccp()
|
||||||
{
|
{
|
||||||
local F=$(basename $1)
|
local F="$(basename "$1")"
|
||||||
[ -d "$ZAPRET_BASE/$2" ] || mkdir "$ZAPRET_BASE/$2"
|
[ -d "$ZAPRET_BASE/$2" ] || mkdir "$ZAPRET_BASE/$2"
|
||||||
[ -f "$ZAPRET_BASE/$2/$F" ] && rm -f "$ZAPRET_BASE/$2/$F"
|
[ -f "$ZAPRET_BASE/$2/$F" ] && rm -f "$ZAPRET_BASE/$2/$F"
|
||||||
ln -fs "../$BINS/$1" "$ZAPRET_BASE/$2" && echo linking : "../$BINS/$1" =\> "$ZAPRET_BASE/$2"
|
ln -fs "../$BINS/$1" "$ZAPRET_BASE/$2" && echo linking : "../$BINS/$1" =\> "$ZAPRET_BASE/$2"
|
||||||
|
@ -540,7 +540,7 @@ check_location()
|
|||||||
fix_perms "$ZAPRET_TARGET"
|
fix_perms "$ZAPRET_TARGET"
|
||||||
[ "$keep" = "Y" ] && backup_restore_settings 0
|
[ "$keep" = "Y" ] && backup_restore_settings 0
|
||||||
echo relaunching itself from $ZAPRET_TARGET
|
echo relaunching itself from $ZAPRET_TARGET
|
||||||
exec "$ZAPRET_TARGET/$(basename $0)"
|
exec "$ZAPRET_TARGET/$(basename "$0")"
|
||||||
else
|
else
|
||||||
echo copying aborted. exiting
|
echo copying aborted. exiting
|
||||||
exitp 3
|
exitp 3
|
||||||
|
Loading…
Reference in New Issue
Block a user