[mirrorbrain-commits] r8316 - /trunk/tools/geoip-lite-update

From: <poeml_at_mirrorbrain.org>
Date: Thu, 02 Jan 2014 22:07:32 -0000
Author: poeml
Date: Thu Jan  2 23:07:31 2014
New Revision: 8316

URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain?rev=8316&view=rev
Log:
geoip-lite-update:
- make it possible to run without reloading Apache
- be able to reload Apache on openSUSE, Ubuntu, Debian, Fedora, and via systemd

Modified:
    trunk/tools/geoip-lite-update

Modified: trunk/tools/geoip-lite-update
URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain/trunk/tools/geoip-lite-update?rev=8316&r1=8315&r2=8316&view=diff
==============================================================================
--- trunk/tools/geoip-lite-update	(original)
+++ trunk/tools/geoip-lite-update	Thu Jan  2 23:07:31 2014
_at_@ -1,7 +1,7 @@
 #!/bin/bash
 
 # geoip-lite-update -- update geoip lite database(s).
-# (c) 2008,2009,2010,2011,2012 poeml_at_cmdline.net
+# (c) 2008,2009,2010,2011,2012,2013,2014 poeml_at_cmdline.net
 # Distribute under GPLv2 if it proves worthy.
 
 for i in curl wget ftp; do
_at_@ -48,4 +48,17 @@
 gunzip -c GeoIPv6.dat.gz > GeoIPv6.dat.updated.new
 mv GeoIPv6.dat.updated.new GeoIPv6.dat.updated
 
-/etc/init.d/apache2 reload
+set +e
+
+if [ "$1" = "--no-reload" ]; then
+	exit 0
+fi
+
+if [ -x /etc/init.d/apache2 ]; then
+	/etc/init.d/apache2 reload
+elif [ -x /etc/init.d/httpd ]; then
+	/etc/init.d/httpd reload
+elif [ -x /usr/bin/systemctl ]; then
+	/usr/bin/systemctl daemon-reload >/dev/null 2>&1 || :
+fi
+




_______________________________________________
mirrorbrain-commits mailing list
Archive: http://mirrorbrain.org/archive/mirrorbrain-commits/

Note: To remove yourself from this list, send a mail with the content
 	unsubscribe
to the address mirrorbrain-commits-request_at_mirrorbrain.org
Received on Thu Jan 02 2014 - 22:07:34 GMT

This archive was generated by hypermail 2.3.0 : Thu Jan 02 2014 - 22:17:07 GMT