Make sure we load external scripts before using eerror

Reported-by: Jochen Schlick <josch06@gmail.com>
X-Gentoo-Bug: 388715
X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=388715
This commit is contained in:
William Hubbs 2011-11-02 08:16:52 -05:00
parent 5066d40ac8
commit 27713e3a41

View File

@ -33,6 +33,14 @@ loadconfig()
fi
}
sourcex "@SYSCONFDIR@/init.d/functions.sh"
sourcex "@LIBEXECDIR@/sh/rc-functions.sh"
# Support LiveCD foo
if sourcex -e "/sbin/livecd-functions.sh"; then
livecd_read_commandline
fi
if [ ! -e ${RC_SVCDIR}/softlevel ]; then
eerror "You are attempting to run an openrc service on a"
eerror "system which openrc did not boot."
@ -45,14 +53,6 @@ if [ ! -e ${RC_SVCDIR}/softlevel ]; then
exit 1
fi
sourcex "@SYSCONFDIR@/init.d/functions.sh"
sourcex "@LIBEXECDIR@/sh/rc-functions.sh"
# Support LiveCD foo
if sourcex -e "/sbin/livecd-functions.sh"; then
livecd_read_commandline
fi
if [ -z "$1" -o -z "$2" ]; then
eerror "$RC_SVCNAME: not enough arguments"
exit 1