[Fai-commit] r4410 - in people/lazyboy/rhel-install-fixes_3.1.8/examples/rhel-install-demo/scripts: RHEL-DEMO-TOMCAT RHEL-DEMO-WEBSERVER

lazyboy-guest at alioth.debian.org lazyboy-guest at alioth.debian.org
Fri Jul 6 22:42:55 UTC 2007


Author: lazyboy-guest
Date: 2007-07-06 22:42:55 +0000 (Fri, 06 Jul 2007)
New Revision: 4410

Modified:
   people/lazyboy/rhel-install-fixes_3.1.8/examples/rhel-install-demo/scripts/RHEL-DEMO-TOMCAT/20-install-java
   people/lazyboy/rhel-install-fixes_3.1.8/examples/rhel-install-demo/scripts/RHEL-DEMO-TOMCAT/40-install-tomcat
   people/lazyboy/rhel-install-fixes_3.1.8/examples/rhel-install-demo/scripts/RHEL-DEMO-WEBSERVER/50-install-phpmyadmin
Log:
make scripts idempotent

Modified: people/lazyboy/rhel-install-fixes_3.1.8/examples/rhel-install-demo/scripts/RHEL-DEMO-TOMCAT/20-install-java
===================================================================
--- people/lazyboy/rhel-install-fixes_3.1.8/examples/rhel-install-demo/scripts/RHEL-DEMO-TOMCAT/20-install-java	2007-07-06 22:42:19 UTC (rev 4409)
+++ people/lazyboy/rhel-install-fixes_3.1.8/examples/rhel-install-demo/scripts/RHEL-DEMO-TOMCAT/20-install-java	2007-07-06 22:42:55 UTC (rev 4410)
@@ -1,6 +1,15 @@
 #! /bin/bash
 
-# TODO: only do this if jdk is not already installed!
+# only do this if jdk is not already installed!
+# TODO: use a niver way to check for this
 
+if [ ! -z `rpm -q jdk | grep -v "not installed"` ]; then
+	echo "JDK is already installed - exiting"
+	exit 0
+else 
+	echo "is not installed"
+fi
+
+[ -f $target/tmp/jdk-6u1-linux-i586.rpm ] && rm  /tmp/jdk-6u1-linux-i586.rpm
 $ROOTCMD wget -P/tmp http://debmirror/mirrors/binary-packages/jdk-6u1-linux-i586.rpm
 $ROOTCMD rpm -i /tmp/jdk-6u1-linux-i586.rpm

Modified: people/lazyboy/rhel-install-fixes_3.1.8/examples/rhel-install-demo/scripts/RHEL-DEMO-TOMCAT/40-install-tomcat
===================================================================
--- people/lazyboy/rhel-install-fixes_3.1.8/examples/rhel-install-demo/scripts/RHEL-DEMO-TOMCAT/40-install-tomcat	2007-07-06 22:42:19 UTC (rev 4409)
+++ people/lazyboy/rhel-install-fixes_3.1.8/examples/rhel-install-demo/scripts/RHEL-DEMO-TOMCAT/40-install-tomcat	2007-07-06 22:42:55 UTC (rev 4410)
@@ -1,7 +1,20 @@
 #! /bin/bash
 
-$ROOTCMD wget -P/tmp http://debmirror/mirrors/binary-packages/apache-tomcat-6.0.13.tar.gz
-$ROOTCMD tar xfz /tmp/apache-tomcat-6.0.13.tar.gz -C /opt/
+# only if tomcat is not already there
 
+[ ! -d /opt/apache-tomcat-6.0.13 ] && {
+	[ -f /tmp/apache-tomcat-6.0.13.tar.gz ] && rm /tmp/apache-tomcat-6.0.13.tar.gz
+	
+	$ROOTCMD wget -P/tmp http://debmirror/mirrors/binary-packages/apache-tomcat-6.0.13.tar.gz
+	$ROOTCMD tar xfz /tmp/apache-tomcat-6.0.13.tar.gz -C /opt/
+}
+
+[ -e /opt/tomcat ] && rm /opt/tomcat
+
+$ROOTCMD ln -s /opt/apache-tomcat-6.0.13  /opt/tomcat
+
+#[ ! -f /etc/init.d/tomcat6 ] && {
+#	
+#}
 echo "TODO: create a start script, and enable it to be run at system startup"
 #exit 0

Modified: people/lazyboy/rhel-install-fixes_3.1.8/examples/rhel-install-demo/scripts/RHEL-DEMO-WEBSERVER/50-install-phpmyadmin
===================================================================
--- people/lazyboy/rhel-install-fixes_3.1.8/examples/rhel-install-demo/scripts/RHEL-DEMO-WEBSERVER/50-install-phpmyadmin	2007-07-06 22:42:19 UTC (rev 4409)
+++ people/lazyboy/rhel-install-fixes_3.1.8/examples/rhel-install-demo/scripts/RHEL-DEMO-WEBSERVER/50-install-phpmyadmin	2007-07-06 22:42:55 UTC (rev 4410)
@@ -1,5 +1,12 @@
 #!/bin/sh
-$ROOTCMD wget -P/tmp http://debmirror/mirrors/binary-packages/phpMyAdmin-2.10.2-english.tar.bz2
-$ROOTCMD tar xfj /tmp/phpMyAdmin-2.10.2-english.tar.bz2 -C /var/www/html/
+
+[ ! -d /var/www/html/phpMyAdmin-2.10.2-english ] && {
+	[ -f /tmp/phpMyAdmin-2.10.2-english.tar.bz2 ] && rm /tmp/phpMyAdmin-2.10.2-english.tar.bz2
+	# FIXME: better find wget option to overwrite target!
+	$ROOTCMD wget -P/tmp http://debmirror/mirrors/binary-packages/phpMyAdmin-2.10.2-english.tar.bz2
+	$ROOTCMD tar xfj /tmp/phpMyAdmin-2.10.2-english.tar.bz2 -C /var/www/html/
+}
+
+[ -d /var/www/html/myadmin ] && rm /var/www/html/myadmin
 $ROOTCMD ln -s /var/www/html/phpMyAdmin-2.10.2-english /var/www/html/myadmin
 




More information about the Fai-commit mailing list