load site specific profile file (from deb.sipwise.com/kantan/) with bootoption ngcpprofile=filename

dummy profile file testprofile1
ksolomko/vlan
Erhard Rank 14 years ago
parent 3b71cbe24b
commit 2f16c289da

@ -181,6 +181,31 @@ if checkBootParam ngcpmcast ; then
fi
## }}}
# load site specific profile file
# TODO - improve :), check side effects
PROFILESERVER=deb.sipwise.com/kantan/
if checkBootParam ngcpprofile ; then
PROFILE="$(getBootParam ngcpprofile)" || true
rm $PROFILE # so wget does not rename local file, TODO: might destroy local file
wget http://$PROFILESERVER/$PROFILE
WGETRESULT=$?
if [ "X$WGETRESULT" != "X0" ] ; then
echo "Error: Could not get profile file $PROFILE from $PROFILESERVER"
echo " (wget error code $WGETRESULT)"
exit 1
else
if [ -e $PROFILE ] ; then
. $PROFILE
echo "Profile $PROFILE loaded"
rm $PROFILE # clean up
else
echo "Error: Profile file $PROFILE not available (locally, after wget)"
exit 1
fi
fi
fi
## interactive mode {{{
# support command line options, overriding autodetected defaults
INTERACTIVE=true

@ -0,0 +1,12 @@
# test profile
#
# this is just for verifying functionality
# actually, the profiles should contain deployment site specific configurations
export PROFILE=testprofile1
export DATE=$(date)
echo "$DATE - $PROFILE loaded"
echo "$DATE - $PROFILE loaded from $0" >> /var/log/ngcpprofilefileloaded.log
sleep 4 # to see the prompt
Loading…
Cancel
Save