mirror of
https://github.com/sbopkg/sbopkg
synced 2024-12-27 09:58:28 +01:00
changed the way missing variables are handled; thanks to slakmagik for the suggestions
This commit is contained in:
parent
96e4fbd924
commit
38e42516d8
1 changed files with 12 additions and 9 deletions
|
@ -43,17 +43,20 @@ if [ ! -e $SBOPKG_CONF ]; then
|
|||
echo "Please create it and run $SCRIPT again." 1>&2
|
||||
exit 1
|
||||
else
|
||||
for i in RSYNCMIRROR SLACKVER LOCALREPO SRCDIR TMP KEEPLOG
|
||||
do
|
||||
grep "^$i=.\{1,\}" "$SBOPKG_CONF" > /dev/null
|
||||
if [ "$?" != 0 ]; then
|
||||
echo "$SCRIPT: Can't find variable $i declared in"
|
||||
echo "$SCRIPT: $SBOPKG_CONF."
|
||||
echo "Please declare it and run $SCRIPT again."
|
||||
. $SBOPKG_CONF
|
||||
for VAR in RSYNCMIRROR SLACKVER LOCALREPO SRCDIR TMP KEEPLOG; do
|
||||
if [ -z "${!VAR}" ]; then
|
||||
MISSING+="$VAR "
|
||||
fi
|
||||
done
|
||||
if [ "$MISSING" ]; then
|
||||
echo "$SCRIPT: Can't find a value for variable(s):"
|
||||
echo "$MISSING"
|
||||
echo "Please correct this error and run $SCRIPT again."
|
||||
exit 1
|
||||
fi
|
||||
. $SBOPKG_CONF
|
||||
done
|
||||
#. $SBOPKG_CONF
|
||||
#done
|
||||
fi
|
||||
if [ ! -d "$SRCDIR" ]; then
|
||||
echo "Creating local cache directory $SRCDIR to keep \
|
||||
|
|
Loading…
Reference in a new issue