[PC-BSD Commits] r17288 - pcbsd/current/src-sh/pc-thinclient

svn at pcbsd.org svn at pcbsd.org
Fri Jun 15 07:29:02 PDT 2012


Author: kris
Date: 2012-06-15 14:29:01 +0000 (Fri, 15 Jun 2012)
New Revision: 17288

Modified:
   pcbsd/current/src-sh/pc-thinclient/pc-thinclient
Log:

Add -remove flag to pc-thinclient, which lets us remove the PXEWORLD
environment, and re-run the utility later. Any stuff previously setup will
still be used on the system, to save time on future runs. 



Modified: pcbsd/current/src-sh/pc-thinclient/pc-thinclient
===================================================================
--- pcbsd/current/src-sh/pc-thinclient/pc-thinclient	2012-06-15 14:17:32 UTC (rev 17287)
+++ pcbsd/current/src-sh/pc-thinclient/pc-thinclient	2012-06-15 14:29:01 UTC (rev 17288)
@@ -290,6 +290,9 @@
 
 # Function which checks and sets up the thinclient as an install server
 check_installdirs() {
+	if [ -e "${PXEWORLD}/installarchive/PCBSD-Server.txz" ]; then
+	   return
+	fi
 	SYSARCH=`uname -m`
 	touch ${PXEWORLD}/etc/installserver
 	mkdir ${PXEWORLD}/installscripts
@@ -328,9 +331,24 @@
 	exit 1
 }
 
+do_removal() {
+	if [ -d "${PXEWORLD}" ] ; then
+		echo "Removing ${PXEWORLD}"
+		rm -rf ${PXEWORLD} 2>/dev/null
+		chflags -R noschg ${PXEWORLD} 2>/dev/null
+		rm -rf ${PXEWORLD} 2>/dev/null
+	fi
+}
+
 # Make sure we are root
 if [ `id -u` != "0" ] ; then exit_err "Must be run as root!"; fi
 
+# Check if we are removing the existing thinclient
+if [ "$1" = "-remove" -o "$1" = "remove" ] ;  then
+  do_removal
+  exit 0
+fi
+
 echo "$0 will install the components to convert this system into a thin-client server."
 echo -e "Continue? (Y/N) \c"
 read tmp



More information about the Commits mailing list