Compare commits

..

No commits in common. "addce6782f94594c28a4c9fe141fc0e9d57a6f4f" and "745a8ec928fba1eb0553479199e0e7cb9101a1cf" have entirely different histories.

3 changed files with 10 additions and 12 deletions

View File

@ -376,23 +376,23 @@ select_mode_iface()
esac esac
} }
default_files() ipset_default_files()
{ {
[ -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" [ -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"
[ -f "$1/ipset/$file/zapret-hosts-user.txt" ] || echo nonexistent.domain >> "$1/ipset/$file/zapret-hosts-user.txt" [ -f "$1/ipset/$file/zapret-hosts-user.txt" ] || echo nonexistent.domain >> "$1/ipset/$file/zapret-hosts-user.txt"
[ -f "$1/ipset/$file/zapret-hosts-user-ipban.txt" ] || touch "$1/ipset/$file/zapret-hosts-user-ipban.txt" [ -f "$1/ipset/$file/zapret-hosts-user-ipban.txt" ] || touch "$1/ipset/$file/zapret-hosts-user-ipban.txt"
for dir in openwrt sysv macos; do
[ -d "$1/init.d/$dir" ] && {
[ -f "$1/init.d/$dir/custom" ] || cp "$1/init.d/$dir/custom.default" "$1/init.d/$dir/custom"
}
done
} }
copy_all() copy_all()
{ {
local dir local dir
cp -R "$1" "$2" cp -R "$1" "$2"
[ -d "$2/tmp" ] || mkdir "$2/tmp" [ -d "$2/tmp" ] || mkdir "$2/tmp"
for dir in openwrt sysv macos; do
[ -f "$2/init.d/$dir/custom" ] || cp "$2/init.d/$dir/custom.default" "$2/init.d/$dir/custom"
done
ipset_default_files "$2"
} }
copy_openwrt() copy_openwrt()
{ {
@ -406,6 +406,8 @@ copy_openwrt()
cp -R "$1/files/fake" "$2/files" cp -R "$1/files/fake" "$2/files"
cp -R "$1/common" "$1/ipset" "$2" cp -R "$1/common" "$1/ipset" "$2"
cp -R "$1/init.d/openwrt" "$2/init.d" cp -R "$1/init.d/openwrt" "$2/init.d"
[ -f "$2/init.d/openwrt/custom" ] || cp "$2/init.d/openwrt/custom.default" "$2/init.d/openwrt/custom"
ipset_default_files "$2"
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" 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"
cp "$BINDIR/tpws" "$BINDIR/nfqws" "$BINDIR/ip2net" "$BINDIR/mdig" "$2/binaries/$ARCH" cp "$BINDIR/tpws" "$BINDIR/nfqws" "$BINDIR/ip2net" "$BINDIR/mdig" "$2/binaries/$ARCH"
} }
@ -492,9 +494,7 @@ check_location()
echo \* checking location echo \* checking location
# use inodes in case something is linked # use inodes in case something is linked
if [ -d "$ZAPRET_TARGET" ] && [ $(get_dir_inode "$EXEDIR") = $(get_dir_inode "$ZAPRET_TARGET") ]; then [ -d "$ZAPRET_TARGET" ] && [ $(get_dir_inode "$EXEDIR") = $(get_dir_inode "$ZAPRET_TARGET") ] || {
default_files "$ZAPRET_TARGET"
else
echo echo
echo easy install is supported only from default location : $ZAPRET_TARGET echo easy install is supported only from default location : $ZAPRET_TARGET
echo currently its run from $EXEDIR echo currently its run from $EXEDIR
@ -525,7 +525,7 @@ check_location()
echo copying aborted. exiting echo copying aborted. exiting
exitp 3 exitp 3
fi fi
fi }
echo running from $EXEDIR echo running from $EXEDIR
} }

View File

@ -8,7 +8,6 @@ ZAPRET_CONFIG="$EXEDIR/config"
ZAPRET_BASE="$EXEDIR" ZAPRET_BASE="$EXEDIR"
[ -f "$ZAPRET_CONFIG" ] || cp "${ZAPRET_CONFIG}.default" "$ZAPRET_CONFIG" [ -f "$ZAPRET_CONFIG" ] || cp "${ZAPRET_CONFIG}.default" "$ZAPRET_CONFIG"
. "$ZAPRET_CONFIG"
. "$ZAPRET_BASE/common/base.sh" . "$ZAPRET_BASE/common/base.sh"
. "$ZAPRET_BASE/common/elevate.sh" . "$ZAPRET_BASE/common/elevate.sh"
. "$ZAPRET_BASE/common/fwtype.sh" . "$ZAPRET_BASE/common/fwtype.sh"

View File

@ -8,7 +8,6 @@ IPSET_DIR="$EXEDIR/ipset"
ZAPRET_CONFIG="$EXEDIR/config" ZAPRET_CONFIG="$EXEDIR/config"
ZAPRET_BASE="$EXEDIR" ZAPRET_BASE="$EXEDIR"
[ -f "$ZAPRET_CONFIG" ] || cp "${ZAPRET_CONFIG}.default" "$ZAPRET_CONFIG"
. "$ZAPRET_CONFIG" . "$ZAPRET_CONFIG"
. "$ZAPRET_BASE/common/base.sh" . "$ZAPRET_BASE/common/base.sh"
. "$ZAPRET_BASE/common/elevate.sh" . "$ZAPRET_BASE/common/elevate.sh"