1 |
#!/bin/bash |
#!/bin/bash |
2 |
|
|
3 |
die() { echo "Error: $@"; exit 1; } |
# set default variables |
4 |
|
: ${MAGERC="@@SYSCONFDIR@@/mage.rc"} |
5 |
|
: ${MLIBDIR="@@MAGELIBDIR@@"} |
6 |
|
|
7 |
# include all needed files |
# include all needed files |
8 |
[ -f /etc/mage.rc.global ] && source /etc/mage.rc.global || die "/etc/mage.rc.global missing" |
source ${MLIBDIR}/common.functions.sh || exit 1 |
9 |
[ -f ${MAGERC} ] && source ${MAGERC} || die "Your ${MAGERC} is missing. Aborting." |
source @@SYSCONFDIR@@/mage.rc.global || die "@@SYSCONFDIR@@/mage.rc.global missing." |
10 |
# overrides die() function |
source ${MAGERC} || die "${MAGERC} missing." |
11 |
[ -f ${MLIBDIR}/common.functions.sh ] && source ${MLIBDIR}/common.functions.sh || die "common mage functions missing" |
source ${MLIBDIR}/mage4.functions.sh || die "${MLIBDIR}/mage4.functions.sh missing." |
12 |
[ -f ${MLIBDIR}/mage4.functions.sh ] && source ${MLIBDIR}/mage4.functions.sh || die "mage functions missing" |
source ${MLIBDIR}/smage2.functions.sh || die "${MLIBDIR}/smage2.functions.sh missing." |
13 |
[ -f ${MLIBDIR}/smage2.functions.sh ] && source ${MLIBDIR}/smage2.functions.sh || die "smage functions missing" |
source @@SYSCONFDIR@@/up2date.conf || die "@@SYSCONFDIR@@/up2date.conf missing." |
|
[ -f /etc/up2date.conf ] && source /etc/up2date.conf || die "/etc/up2date.conf missing" |
|
14 |
|
|
15 |
# respect repos from env or load repos from config file |
# respect repos from env or load repos from config file |
16 |
if [[ -z ${REPOS} ]] && [[ -n ${SMAGE_REPOS} ]] |
if [[ -z ${REPOS} ]] && [[ -n ${SMAGE_REPOS} ]] |