summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2006-02-04 05:27:35 +0000
committerMike Frysinger <vapier@gentoo.org>2006-02-04 05:27:35 +0000
commit2a9e28b5b44dd6b181110307b75fed764590b46e (patch)
tree211c1c315628f52b72b09b61e5ae6d92296e00c0 /bin/newinitd
parentSimon Stelling writes in Bug 121317: (diff)
downloadportage-multirepo-2a9e28b5b44dd6b181110307b75fed764590b46e.tar.gz
portage-multirepo-2a9e28b5b44dd6b181110307b75fed764590b46e.tar.bz2
portage-multirepo-2a9e28b5b44dd6b181110307b75fed764590b46e.zip
touchup code so we handle errors better
svn path=/main/trunk/; revision=2651
Diffstat (limited to 'bin/newinitd')
-rwxr-xr-xbin/newinitd10
1 files changed, 5 insertions, 5 deletions
diff --git a/bin/newinitd b/bin/newinitd
index c6513460..50a4d54d 100755
--- a/bin/newinitd
+++ b/bin/newinitd
@@ -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}"