[commit] r2312 - trunk/vendors/Nintendo/common/rc.d

dslinux_sonny_jim at dslinux.in-berlin.de dslinux_sonny_jim at dslinux.in-berlin.de
Fri Jul 25 18:52:49 CEST 2008


Author: dslinux_sonny_jim
Date: Fri Jul 25 18:52:49 2008
New Revision: 2312

Log:
Add some sanity checks to /etc/rc.d/update

Modified:
   trunk/vendors/Nintendo/common/rc.d/update

Modified: trunk/vendors/Nintendo/common/rc.d/update
==============================================================================
--- trunk/vendors/Nintendo/common/rc.d/update	(original)
+++ trunk/vendors/Nintendo/common/rc.d/update	Fri Jul 25 18:52:49 2008
@@ -85,14 +85,26 @@
 		# Check for update
 		$0 check
 		# Download
-		# Get mirror from temp file as export doesn't seem to work
-		MIRROR=`cat /tmp/update.mirror`
-		rm /tmp/update.mirror
+		# Get MIRROR from temp file as export doesn't seem to work
+		if [ -f /tmp/update.mirror ]
+		then
+			MIRROR=`cat /tmp/update.mirror`
+			rm /tmp/update.mirror
+		else
+			echo "Could not find /tmp/update.mirror"
+			exit 1
+		fi
+		# Clear out any previous temp file
+		if [ -f /tmp/update.downloadto ]
+		then
+			rm /tmp/update.downloadto
+		fi
 		if [ $DOWNLOADTO="" ]
 		then
 			echo "No download location specified, downloading to /media"
 			DOWNLOADTO="/media"
 		fi
+		echo $DOWNLOADTO > /tmp/update.downloadto
 		if [ -f $DOWNLOADTO/dslinux-dldi.tgz ]
 		then
 			echo "Previous download detected"
@@ -106,6 +118,15 @@
 		# Download
 		$0 download
 		# Unpack
+		# Get DOWNLOADTO from file
+		if [ -f /tmp/update.downloadto ]
+		then
+			DOWNLOADTO=`cat /tmp/update.downloadto`
+			rm /tmp/update.downloadto
+		else
+			echo "Could not find /tmp/update.downloadto"
+			exit 1
+		fi
 		echo "Unpacking, may take a long time.  Do not switch off!"
 		gzip -d -c $DOWNLOADTO/dslinux-dldi.tgz | tar xv --no-same-owner -C /media
 		echo "Unpacking complete"


More information about the dslinux-commit mailing list