From 2bdb6950e956f00ea3452c82fc1de46244022392 Mon Sep 17 00:00:00 2001 From: Stefan Saraev Date: Fri, 24 Nov 2017 21:45:43 +0200 Subject: [PATCH] enhancements to XLXHostsupdate.sh - make it executable - path to xlxhosts.txt can be specified as cmdline argument, defaults to script's dir --- XLXHostsupdate.sh | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) mode change 100644 => 100755 XLXHostsupdate.sh diff --git a/XLXHostsupdate.sh b/XLXHostsupdate.sh old mode 100644 new mode 100755 index 6ffdcce..fc6298f --- a/XLXHostsupdate.sh +++ b/XLXHostsupdate.sh @@ -41,16 +41,26 @@ # # ... and add the following line to the bottom of the file ... # -# 0 0 * * * /path/to/script/XLXHostsupdate.sh 1>/dev/null 2>&1 +# 0 0 * * * /path/to/script/XLXHostsupdate.sh /path/to/XLXHosts.txt 1>/dev/null 2>&1 # -# ... where /path/to/script/ should be replaced by the path to this script. +# ... where: +# /path/to/script/ should be replaced by the path to this script. +# /path/to/XLXHosts.txt should be replaced by the path to XLX hosts file # ############################################################################### # # CONFIGURATION # -# Full path to XLXHosts -XLXHOSTS=/path/to/XLXHosts.txt +# first argument as path to XLXHosts.txt. +# default so script's directory if empty + +if [ -n "$1" ] ; then + XLXHOSTS="$1" +else + XLXHOSTS="$(dirname $0)/XLXHosts.txt" +fi + +echo "Updating $XLXHOSTS ..." # How many XLXHosts files do you want backed up (0 = do not keep backups) XLXHOSTSFILEBACKUP=1