2 |
# $Id$ |
# $Id$ |
3 |
# dependeny walker |
# dependeny walker |
4 |
|
|
|
# default die function |
|
|
die() |
|
|
{ |
|
|
echo ${COLRED}"$@"${COLDEFAULT} |
|
|
exit 1 |
|
|
} |
|
|
|
|
5 |
decho() |
decho() |
6 |
{ |
{ |
7 |
if [[ ${DEBUG} = 1 ]] |
if [[ ${DEBUG} = 1 ]] |
10 |
fi |
fi |
11 |
} |
} |
12 |
|
|
13 |
# include all needed files |
# set default variables |
14 |
[ -f /etc/mage.rc.global ] && \ |
: ${MAGERC="@@SYSCONFDIR@@/mage.rc"} |
15 |
source /etc/mage.rc.global || \ |
: ${MLIBDIR="@@MAGELIBDIR@@"} |
16 |
die "/etc/mage.rc.global missing" |
|
17 |
|
# first of all include common functions |
18 |
[ -f ${MAGERC} ] && source ${MAGERC} || \ |
source ${MLIBDIR}/common.functions.sh || exit 1 |
19 |
die "Your ${MAGERC} is missing. Aborting." |
source @@SYSCONFDIR@@/mage.rc.global || die "@@SYSCONFDIR@@/mage.rc.global missing" |
20 |
|
source ${MAGERC} || die "Your ${MAGERC} is missing. Aborting." |
21 |
[ -f ${MLIBDIR}/mage4.functions.sh ] && \ |
source ${MLIBDIR}/mage4.functions.sh || die "mage functions missing" |
22 |
source ${MLIBDIR}/mage4.functions.sh || \ |
source ${MLIBDIR}/smage2.functions.sh || die "smage functions missing" |
|
die "mage functions missing" |
|
|
|
|
|
[ -f ${MLIBDIR}/smage2.functions.sh ] && \ |
|
|
source ${MLIBDIR}/smage2.functions.sh || \ |
|
|
die "smage functions missing" |
|
23 |
|
|
24 |
usage() |
usage() |
25 |
{ |
{ |