Fixed IP address determination

This commit is contained in:
Deon George 2018-03-16 16:30:19 +11:00
parent f0a59b762d
commit 9081cbb017

View File

@ -13,8 +13,9 @@ DOMINO_BIN=/opt/ibm/domino/bin/server
test -x $DOMINO_BIN || exit 5
DOMINO_USR=notes
DOMINO_DIR=/notesdata
cd /notesdata
cd ${DOMINO_DIR}
[ -f .init ] && . ./.init
case "$1" in
@ -26,8 +27,8 @@ case "$1" in
echo "Domino setup is listening on 1352"
su ${DOMINO_USR} -c "${DOMINO_BIN} -listen 1352"
cp -pR /notesdata/* /data/
echo "Please start domino with -v <SRC>:/notesdata"
cp -pR ${DOMINO_DIR}/* /data/
echo "Please start domino with -v <SRC>:${DOMINO_DIR}"
;;
start)
@ -41,7 +42,7 @@ case "$1" in
# Change our primary interface address for traveler
OURIP=$(ip route get $(ip route show 0.0.0.0/0 | grep -oP 'via \K\S+') | grep -oP 'src \K\S+')
sed -i -r "s/^(NTS_HOST_IP_ADDR)=[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/\1=${OURIP}/" notes.ini
sed -i -r "s/^(NTS_HOST_IP_ADDR)=([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})?/\1=${OURIP}/" ${DOMINO_DIR}/notes.ini
echo -n "Starting Domino server"
start &