This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
domino/domino.sh

62 lines
1.3 KiB
Bash
Raw Permalink Normal View History

2017-07-23 12:55:17 +00:00
#!/bin/sh
function start {
su ${DOMINO_USR} -c "$DOMINO_BIN -jc -c"
}
function stop {
su ${DOMINO_USR} -c "echo Y| $DOMINO_BIN -jc -q"
}
# set the domino path and user name under which domino will run
DOMINO_BIN=/opt/ibm/domino/bin/server
test -x $DOMINO_BIN || exit 5
DOMINO_USR=notes
2018-03-16 05:30:19 +00:00
DOMINO_DIR=/notesdata
2017-07-23 12:55:17 +00:00
2018-03-16 05:30:19 +00:00
cd ${DOMINO_DIR}
2017-07-23 12:55:17 +00:00
[ -f .init ] && . ./.init
case "$1" in
setup)
if [ ! -d /data ]; then
echo "Please start with -v <SRC>:/data, so that your domino data can be initiated" && exit 1
fi
echo "Domino setup is listening on 1352"
su ${DOMINO_USR} -c "${DOMINO_BIN} -listen 1352"
2018-03-16 05:30:19 +00:00
cp -pR ${DOMINO_DIR}/* /data/
echo "Please start domino with -v <SRC>:${DOMINO_DIR}"
2017-07-23 12:55:17 +00:00
;;
start)
trap 'stop' SIGTERM
MAX_OPEN_FILES=`ulimit -n`
if [ $MAX_OPEN_FILES -lt 60000 ]; then
echo "setting maximum open files to 60000"
ulimit -n 60000
fi
# 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+')
2018-03-16 05:30:19 +00:00
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
2017-07-23 12:55:17 +00:00
echo -n "Starting Domino server"
start &
wait
;;
stop)
echo -n "Shutting down Domino server"
stop
;;
*)
echo "Usage: $0 {setup|start|stop}"
exit 1
;;
esac