[PC-BSD Commits] r19039 - pcbsd/current/src-sh/pc-netupdate

svn at pcbsd.org svn at pcbsd.org
Tue Sep 11 08:07:43 PDT 2012


Author: kris
Date: 2012-09-11 15:07:43 +0000 (Tue, 11 Sep 2012)
New Revision: 19039

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

Use libsh for pc-netupdate



Modified: pcbsd/current/src-sh/pc-netupdate/pc-netupdate
===================================================================
--- pcbsd/current/src-sh/pc-netupdate/pc-netupdate	2012-09-11 15:03:10 UTC (rev 19038)
+++ pcbsd/current/src-sh/pc-netupdate/pc-netupdate	2012-09-11 15:07:43 UTC (rev 19039)
@@ -4,6 +4,9 @@
 # Author: Kris Moore
 ########################################################################
 
+# Source our functions
+. /usr/local/share/pcbsd/scripts/functions.sh
+
 # Location of files to work on
 FILEDBDIR="/var/db/pc-netupdate" 
 
@@ -14,10 +17,6 @@
   mkdir -p "${FILEDBDIR}"
 fi
 
-# Start by sourcing /etc/profile
-# This grabs any HTTP_ / FTP_ PROXY variables
-. /etc/profile
-
 # Check for updates to do
 check_updates() {
 
@@ -50,21 +49,12 @@
 	fi
 
         oFile=`mktemp /tmp/.XXXXXXXXXXXX`
-	fetch -o $oFile "${RURL}" >/dev/null 2>/dev/null
-	if [ "$?" != "0" ] ; then
-		echo "Failed to download: $RURL"
-	        rm $oFile
-		return 1
-	fi
+	get_file "${RURL}" "${oFile}" 3
 
 	# If signed, fetch the key
 	if [ "$_signed" = "YES" ] ; then
-	  fetch -o ${oFile}.sha1 "${RURL}.sha1" >/dev/null 2>/dev/null
-	  if [ "$?" != "0" ] ; then
-	     echo "Failed to download: ${RURL}.sha1"
-	     rm $oFile 
-	     return 1
-    	  fi
+	  get_file "${RURL}.sha1" "${oFile}.sha1" 3
+
           openssl dgst -sha1 -verify ${_upDir}/pub.key -signature ${oFile}.sha1 ${oFile} >/dev/null 2>/dev/null
           if [ "$?" != "0" ] ; then
 	     echo "Failed to verify: ${RURL}"



More information about the Commits mailing list