]> gitweb.fluxo.info Git - httruta.git/commitdiff
More cleanup and merging
authorSilvio Rhatto <rhatto@riseup.net>
Mon, 26 Aug 2013 01:14:43 +0000 (22:14 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Mon, 26 Aug 2013 01:14:43 +0000 (22:14 -0300)
httracker
lib/httracker/functions
scuttler

index 0651be47001b54aaf445f4f3a895a441918b2eb7..cd99f601078adc352b39bccb248eb39b836f78cd 100755 (executable)
--- a/httracker
+++ b/httracker
@@ -3,15 +3,9 @@
 # Httrack feed downloader.
 #
 
-# Configuration
-source `dirname $0`/config || exit 1
-
-# Functions
+# Load and initialize
 source `dirname $0`/lib/httracker/functions || exit 1
 
-# Create folders
-httracker_setup_folders
-
 # Get URLs from feed
 # Thanks http://stackoverflow.com/questions/443991/how-to-parse-rss-feeds-xml-in-a-shell-script
 curl -s "$FEED" | grep -o '<link>[^<]*' | grep -o "[^>]*$" > $URLS
index 08852069723a985358472926deecf9fed49e2375..8e8964e4db6793abf5501d9627441f631e0240d3 100644 (file)
@@ -107,3 +107,14 @@ function httracker_setup_folders {
     chown -R $USER.$GROUP $TMP
   fi
 }
+
+# Set basic environment
+function httracker_set_env {
+  source `dirname $0`/config || exit 1
+
+  # Create folders
+  httracker_setup_folders
+}
+
+# Initialize
+httracker_set_env
index cb49918f483ae926f6586350e4bb9966feaaf9db..1c6462292642c85955e4eda3aee03c865564b75e 100755 (executable)
--- a/scuttler
+++ b/scuttler
@@ -3,17 +3,10 @@
 # Download all links from a Semantic Scuttle instance.
 #
 
-# Configuration
-source `dirname $0`/config || exit 1
-
-# Functions
+# Load and initialize
 source `dirname $0`/lib/httracker/functions || exit 1
 
-# Create folders
-httracker_setup_folders
-
 # Other parameters
-SCUTTLE_BASE="/var/sites/links"
 SCUTTLEDIR="`basename $( find ${SCUTTLE_BASE} -maxdepth 1 -iname "SemanticScuttle-*" | head -n 1 )`"
 CONFIGFILE="${SCUTTLE_BASE}/${SCUTTLEDIR}/data/config.php"
 DBUSER="`httracker_scuttle_config dbuser`"