SOURCES: resolvconf.init - pldization

glen glen at pld-linux.org
Fri Feb 8 21:54:48 CET 2008


Author: glen                         Date: Fri Feb  8 20:54:48 2008 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- pldization

---- Files affected:
SOURCES:
   resolvconf.init (1.2 -> 1.3) 

---- Diffs:

================================================================
Index: SOURCES/resolvconf.init
diff -u SOURCES/resolvconf.init:1.2 SOURCES/resolvconf.init:1.3
--- SOURCES/resolvconf.init:1.2	Tue Nov 27 00:41:47 2007
+++ SOURCES/resolvconf.init	Fri Feb  8 21:54:43 2008
@@ -25,11 +25,6 @@
 	exit $1
 }
 
-log_action_begin_msg()
-{
-	show "$*"
-}
-
 update()
 {
 	[ -e "$ENABLE_UPDATES_FLAGFILE" ] || return 0
@@ -53,38 +48,53 @@
 	# The "start" method should _only_ be used at boot time.
 	# If you want to update the resolv.conf file then use "reload".
 	# On package upgrade, don't run this.
-	log_action_begin_msg "Setting up resolvconf"
+	show "Setting up resolvconf"
 	umask 022
 	if [ ! -d "$RUN_DIR" ] ; then
-		[ -L "$RUN_DIR" ] || log_action_end_msg_and_exit 1 "$RUN_DIR is neither a directory nor a symbolic link"
+		if [ ! -L "$RUN_DIR" ]; then
+			log_action_end_msg_and_exit 1 "$RUN_DIR is neither a directory nor a symbolic link"
+		fi
 		# Target of symlink is not a dir
-		{ RUN_CANONICALDIR="$(readlink -f "$RUN_DIR")" && [ "$RUN_CANONICALDIR" ] ; } || log_action_end_msg_and_exit 1 "canonical path of the run directory could not be determined"
+		RUN_CANONICALDIR=$(readlink -f "$RUN_DIR")i
+		if [ -z "$RUN_CANONICALDIR" ]; then
+			log_action_end_msg_and_exit 1 "canonical path of the run directory could not be determined"
+		fi
 		# Create directory at the target
-		mkdir "$RUN_CANONICALDIR" || log_action_end_msg_and_exit 1 "error creating directory $RUN_CANONICALDIR"
+		if ! mkdir "$RUN_CANONICALDIR"; then
+		   	log_action_end_msg_and_exit 1 "error creating directory $RUN_CANONICALDIR"
+		fi
 	fi
 	# The run directory exists
 
 	if [ -d "${RUN_DIR}/interface" ] ; then
 		rm -f ${RUN_DIR}/interface/*
 	else
-		mkdir "${RUN_DIR}/interface" || log_action_end_msg_and_exit 1 "error creating directory ${RUN_DIR}/interface"
+		if ! mkdir "${RUN_DIR}/interface"; then
+		   	log_action_end_msg_and_exit 1 "error creating directory ${RUN_DIR}/interface"
+		fi
 	fi
 	# The interface directory exists
 
-	enable_updates || log_action_end_msg_and_exit 1 "could not enable updates"
+	if ! enable_updates; then
+	   	log_action_end_msg_and_exit 1 "could not enable updates"
+	fi
 	update -i
 	log_action_end_msg_and_exit "$?"
 	;;
 stop)
 	# The "stop" method should only be used at shutdown time.
-	log_action_begin_msg "Stopping resolvconf"
+	show "Stopping resolvconf"
 	disable_updates
 	log_action_end_msg_and_exit "$?"
 	;;
 restart)
-	log_action_begin_msg "Restarting resolvconf"
-	[ -d "${RUN_DIR}/interface" ] || log_action_end_msg_and_exit 1 "${RUN_DIR}/interface is not a directory"
-	enable_updates || log_action_end_msg_and_exit 1 "could not enabling updates"
+	show "Restarting resolvconf"
+	if [ ! -d "${RUN_DIR}/interface" ]; then
+	   	log_action_end_msg_and_exit 1 "${RUN_DIR}/interface is not a directory"
+	fi
+	if ! enable_updates; then
+		log_action_end_msg_and_exit 1 "could not enabling updates"
+	fi
 	update
 	log_action_end_msg_and_exit "$?"
 	;;
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/resolvconf.init?r1=1.2&r2=1.3&f=u



More information about the pld-cvs-commit mailing list