touchup code so we handle errors better
authorMike Frysinger <vapier@gentoo.org>
Sat, 4 Feb 2006 05:27:35 +0000 (05:27 -0000)
committerMike Frysinger <vapier@gentoo.org>
Sat, 4 Feb 2006 05:27:35 +0000 (05:27 -0000)
svn path=/main/trunk/; revision=2651

bin/newconfd
bin/newenvd
bin/newinitd

index cb30ec6e291510c327b35a83c398290b19f24dc0..63a38bb78f0126e42625382b09a2c57cee8e75bf 100755 (executable)
@@ -3,11 +3,11 @@
 # Distributed under the terms of the GNU General Public License v2
 # $Id: /var/cvsroot/gentoo-src/portage/bin/newconfd,v 1.2 2004/10/04 13:56:50 vapier Exp $
 
-if [ -z "${T}" ] || [ -z "${2}" ] ; then
-       echo "Nothing defined to do."
+if [[ -z ${T} ]] || [[ -z ${2} ]] ; then
+       echo "$0: Need two arguments, old file and new file" 1>&2
        exit 1
 fi
 
-rm -rf "${T}/${2}"
-cp "${1}" "${T}/${2}"
-doconfd "${T}/${2}"
+rm -rf "${T}/${2}" && \
+cp -f "${1}" "${T}/${2}" && \
+exec doconfd "${T}/${2}"
index ced17098d0ca19848c43dccff789a5ed27be7e7f..07bbec644f0155f9294b7c1bd5fcd72b9deb3ecb 100755 (executable)
@@ -3,11 +3,11 @@
 # Distributed under the terms of the GNU General Public License v2
 # $Id: /var/cvsroot/gentoo-src/portage/bin/newenvd,v 1.2 2004/10/04 13:56:50 vapier Exp $
 
-if [ -z "${T}" ] || [ -z "${2}" ] ; then
-       echo "Nothing defined to do."
+if [[ -z ${T} ]] || [[ -z ${2} ]] ; then
+       echo "$0: Need two arguments, old file and new file" 1>&2
        exit 1
 fi
 
-rm -rf "${T}/${2}"
-cp "${1}" "${T}/${2}"
-doenvd "${T}/${2}"
+rm -rf "${T}/${2}" && \
+cp -f "${1}" "${T}/${2}" && \
+exec doenvd "${T}/${2}"
index c6513460be16ce42656dc8dc0e2c1448c4e9027f..50a4d54d76b9f78d778bfb784c6780122d12ddb3 100755 (executable)
@@ -3,11 +3,11 @@
 # Distributed under the terms of the GNU General Public License v2
 # $Id: /var/cvsroot/gentoo-src/portage/bin/newinitd,v 1.2 2004/10/04 13:56:50 vapier Exp $
 
-if [ -z "${T}" ] || [ -z "${2}" ] ; then
-       echo "Nothing defined to do."
+if [[ -z ${T} ]] || [[ -z ${2} ]] ; then
+       echo "$0: Need two arguments, old file and new file" 1>&2
        exit 1
 fi
 
-rm -rf "${T}/${2}"
-cp "${1}" "${T}/${2}"
-doinitd "${T}/${2}"
+rm -rf "${T}/${2}" && \
+cp -f "${1}" "${T}/${2}" && \
+exec doinitd "${T}/${2}"