[icinga-checkins] icinga.org: icinga-web/jmosshammer/default: * Prepared 1.3 start

git at icinga.org git at icinga.org
Tue Nov 9 11:32:26 CET 2010


Module: icinga-web
Branch: jmosshammer/default
Commit: 85e05dab5620d59955a974e046bef4e37228d5f2
URL:    https://git.icinga.org/?p=icinga-web.git;a=commit;h=85e05dab5620d59955a974e046bef4e37228d5f2

Author: Marius Hein <marius.hein at netways.de>
Date:   Thu Oct  7 10:32:22 2010 +0200

* Prepared 1.3 start
* clearcache script

---

 bin/clearcache.sh.in |   66 +++++++++++++++++++++++++++++++++++++++++++++++--
 etc/make/version.m4  |    2 +-
 2 files changed, 64 insertions(+), 4 deletions(-)

diff --git a/bin/clearcache.sh.in b/bin/clearcache.sh.in
index 7ece30f..0470501 100644
--- a/bin/clearcache.sh.in
+++ b/bin/clearcache.sh.in
@@ -1,4 +1,64 @@
-#!/bin/sh
+#!/bin/bash
 
-rm -rf @prefix@/app/cache/config/*.php
-rm -rf @prefix@/app/cache/content
+PREFIX='@prefix@'
+EXIT=0
+NOTHING=true
+
+function msg_start {
+	echo -n "$1 ... "
+}
+
+function msg_result {
+	EXIT=$?
+
+	if [[ $EXIT -gt 0 ]]; then
+		echo "fail"
+	else
+		echo "ok"
+	fi
+
+	NOTHING=false
+}
+
+if [[ $UID -gt 0 ]]; then
+	echo "You should run this as root"
+	exit 1
+fi
+
+if [[ ! -e $PREFIX ]]; then
+	echo "Basedir '$PREFIX' does not exist!"
+	exit 1
+fi
+
+echo "Basedir: $PREFIX"
+
+CCDIR="$PREFIX/app/cache/config"
+CC_FILES=$(ls $CCDIR/*.php 2>/dev/null | wc -l)
+
+if [[ $CC_FILES -gt 0 ]]; then
+
+	msg_start "Deleting config cache ($CC_FILES files)"
+	
+	rm $CCDIR/*php > /dev/null 2>&1
+	
+	msg_result
+	
+fi
+
+COCDIR="$PREFIX/app/cache/content"
+
+if [[ -e $CODIR ]]; then
+
+	msg_start "Deleting content cache dir"
+	
+	rm -r $CODIR > /dev/null 2>&1
+	
+	msg_result
+	
+fi
+
+if [[ $NOTHING == true ]]; then
+	echo "Cache already purged!"
+fi
+
+exit $EXIT
diff --git a/etc/make/version.m4 b/etc/make/version.m4
index 32d43bc..2765b19 100644
--- a/etc/make/version.m4
+++ b/etc/make/version.m4
@@ -9,5 +9,5 @@ dnl to tag a specific release. Icinga releases do not use
 dnl this name.
 dnl
 
-m4_define([ICINGA_VERSION], [1.2.0])
+m4_define([ICINGA_VERSION], [1.3.0])
 m4_define([ICINGA_RELEASE_DATE], [2010-10-06])





More information about the icinga-checkins mailing list