@@ -376,23 +376,23 @@ select_mode_iface()
376
376
esac
377
377
}
378
378
379
- ipset_default_files ()
379
+ default_files ()
380
380
{
381
381
[ -f " $1 /ipset/$file /zapret-hosts-user-exclude.txt" ] || cp " $1 /ipset/$file /zapret-hosts-user-exclude.txt.default" " $1 /ipset/$file /zapret-hosts-user-exclude.txt"
382
382
[ -f " $1 /ipset/$file /zapret-hosts-user.txt" ] || echo nonexistent.domain >> " $1 /ipset/$file /zapret-hosts-user.txt"
383
383
[ -f " $1 /ipset/$file /zapret-hosts-user-ipban.txt" ] || touch " $1 /ipset/$file /zapret-hosts-user-ipban.txt"
384
+ for dir in openwrt sysv macos; do
385
+ [ -d " $1 /init.d/$dir " ] && {
386
+ [ -f " $1 /init.d/$dir /custom" ] || cp " $1 /init.d/$dir /custom.default" " $1 /init.d/$dir /custom"
387
+ }
388
+ done
384
389
}
385
-
386
390
copy_all ()
387
391
{
388
392
local dir
389
393
390
394
cp -R " $1 " " $2 "
391
395
[ -d " $2 /tmp" ] || mkdir " $2 /tmp"
392
- for dir in openwrt sysv macos; do
393
- [ -f " $2 /init.d/$dir /custom" ] || cp " $2 /init.d/$dir /custom.default" " $2 /init.d/$dir /custom"
394
- done
395
- ipset_default_files " $2 "
396
396
}
397
397
copy_openwrt ()
398
398
{
@@ -406,8 +406,6 @@ copy_openwrt()
406
406
cp -R " $1 /files/fake" " $2 /files"
407
407
cp -R " $1 /common" " $1 /ipset" " $2 "
408
408
cp -R " $1 /init.d/openwrt" " $2 /init.d"
409
- [ -f " $2 /init.d/openwrt/custom" ] || cp " $2 /init.d/openwrt/custom.default" " $2 /init.d/openwrt/custom"
410
- ipset_default_files " $2 "
411
409
cp " $1 /config" " $1 /config.default" " $1 /install_easy.sh" " $1 /uninstall_easy.sh" " $1 /install_bin.sh" " $1 /install_prereq.sh" " $1 /blockcheck.sh" " $2 "
412
410
cp " $BINDIR /tpws" " $BINDIR /nfqws" " $BINDIR /ip2net" " $BINDIR /mdig" " $2 /binaries/$ARCH "
413
411
}
@@ -494,7 +492,9 @@ check_location()
494
492
echo \* checking location
495
493
496
494
# use inodes in case something is linked
497
- [ -d " $ZAPRET_TARGET " ] && [ $( get_dir_inode " $EXEDIR " ) = $( get_dir_inode " $ZAPRET_TARGET " ) ] || {
495
+ if [ -d " $ZAPRET_TARGET " ] && [ $( get_dir_inode " $EXEDIR " ) = $( get_dir_inode " $ZAPRET_TARGET " ) ]; then
496
+ default_files " $ZAPRET_TARGET "
497
+ else
498
498
echo
499
499
echo easy install is supported only from default location : $ZAPRET_TARGET
500
500
echo currently its run from $EXEDIR
@@ -525,7 +525,7 @@ check_location()
525
525
echo copying aborted. exiting
526
526
exitp 3
527
527
fi
528
- }
528
+ fi
529
529
echo running from $EXEDIR
530
530
}
531
531
0 commit comments