OpenIndiana and Solaris port
[oweals/cde.git] / cde / admin / IntegTools / dbTools / installCDE.src
index 8e64bef641b260eacb579acc7f30d28c0017a11f..5a62a342481f13ffe31f505294ccd0d18f414415 100755 (executable)
@@ -51,7 +51,7 @@ REVISION="$(echo "$Revision: /main/20 $" | awk '{print $2}')"
 
 Log()
 {
-  echo "$1" | tee -a $LOGFILE
+  /bin/echo "$1" | tee -a $LOGFILE
 }
 
 MakeTarball()
@@ -207,9 +207,38 @@ CleanDaemons()
       then
         stopsrc -s inetd >>$LOGFILE 2>&1
       fi
-    elif [ "$PLATFORM" = openbsd ]
+    elif [ "$PLATFORM" = "openbsd" ]
     then
-      true
+      ps axo pid,comm | grep $i > /tmp/tmppsout
+      if [ -s /tmp/tmppsout ]
+      then
+        awk '{print "kill " $1}' /tmp/tmppsout | /bin/csh -f
+        sleep 2
+      fi
+    elif [ "$PLATFORM" = "freebsd" ]
+    then
+      ps axo pid,comm | grep $i > /tmp/tmppsout
+      if [ -s /tmp/tmppsout ]
+      then
+        awk '{print "kill " $1}' /tmp/tmppsout | /bin/csh -f
+        sleep 2
+      fi
+    elif [ "$PLATFORM" = "netbsd" ]
+    then
+      ps axo pid,comm | grep $i > /tmp/tmppsout
+      if [ -s /tmp/tmppsout ]
+      then
+        awk '{print "kill " $1}' /tmp/tmppsout | /bin/csh -f
+        sleep 2
+      fi
+    elif [ "$PLATFORM" = "linux" ]
+    then
+      ps axo pid,comm | grep $i > /tmp/tmppsout
+      if [ -s /tmp/tmppsout ]
+      then
+        awk '{print "kill " $1}' /tmp/tmppsout | /bin/sh -f
+        sleep 2
+      fi
     else    
       ps -ef | grep $i | grep -v grep >/tmp/tmppsout
       if [ -s /tmp/tmppsout ]
@@ -228,9 +257,13 @@ RestartInetd()
 
   OLDPWD=`pwd`
   cd /
-  if [ "$PLATFORM" = "sun" -o "$PLATFORM" = "usl" -o "$PLATFORM" = "uxp" ]
+  if [ "$PLATFORM" = "usl" -o "$PLATFORM" = "uxp" ]
   then
     /usr/sbin/inetd -s
+  elif [ "$PLATFORM" = "sun" ]
+  then
+    /usr/sbin/svcadm refresh svc:/network/inetd:default
+    /usr/sbin/svcadm restart svc:/network/inetd:default
   elif [ "$PLATFORM" = "aix" ]
   then
     startsrc -s inetd >>$LOGFILE 2>&1
@@ -239,7 +272,16 @@ RestartInetd()
     /usr/sbin/inetd
   elif [ "$PLATFORM" = "openbsd" ]
   then
-    true
+    /etc/rc.d/inetd start >/dev/null
+  elif [ "$PLATFORM" = "freebsd" ]
+  then
+    /etc/rc.d/inetd onestart
+  elif [ "$PLATFORM" = "netbsd" ]
+  then
+    /etc/rc.d/inetd start >/dev/null
+  elif [ "$PLATFORM" = "linux" ]
+  then
+    /etc/init.d/openbsd-inetd start >/dev/null 2>&1
   else
 #ifdef hpV4
     /usr/sbin/inetd 
@@ -542,11 +584,19 @@ XCOMM
   elif [ $BUILDSYSTEM = "Linux" ];
   then
     PLATFORM="linux"
-    PLATFORM_SCRIPT_DIR=""
+    PLATFORM_SCRIPT_DIR="linux"
+  elif [ $BUILDSYSTEM = "FreeBSD" ];
+  then
+    PLATFORM="freebsd"
+    PLATFORM_SCRIPT_DIR="freebsd"
   elif [ $BUILDSYSTEM = "OpenBSD" ];
   then
     PLATFORM="openbsd"
-    PLATFORM_SCRIPT_DIR=""
+    PLATFORM_SCRIPT_DIR="openbsd"
+  elif [ $BUILDSYSTEM = "NetBSD" ];
+  then
+    PLATFORM="netbsd"
+    PLATFORM_SCRIPT_DIR="netbsd"
   else                 # Build system = HP
     PLATFORM=hp-ux
     PLATFORM_SCRIPT_DIR=hp
@@ -555,7 +605,7 @@ XCOMM
   if [ "$PLATFORM" = "aix" ];
   then
     USER=`/bin/whoami`
-  elif [ "$PLATFORM" = "sun" -o "$PLATFORM" = "usl" -o "$PLATFORM" = "uxp" ];
+  elif [ "$PLATFORM" = "usl" -o "$PLATFORM" = "uxp" ];
   then
     USER=`/usr/ucb/whoami`
   else