Page MenuHomeDevCentral

init
No OneTemporary

#!/bin/bash
set -e
# start supervisord
/usr/bin/supervisord
chmod 775 /app/data
mkdir -p /app/data/openfire
chown -R openfire:openfire /app/data/openfire
# populate default openfire configuration if it does not exist
if [ ! -d /app/data/openfire/etc ]; then
mv /etc/openfire /app/data/openfire/etc
fi
rm -rf /etc/openfire
ln -sf /app/data/openfire/etc /etc/openfire
if [ ! -d /app/data/openfire/lib ]; then
mv /var/lib/openfire /app/data/openfire/lib
fi
rm -rf /var/lib/openfire
ln -sf /app/data/openfire/lib /var/lib/openfire
appStart () {
echo "Starting openfire..."
supervisorctl start openfire >/dev/null
tail -F /usr/share/openfire/logs/info.log
}
appHelp () {
echo "Available options:"
echo " app:start - Start the openfire server (default)"
echo " app:help - Displays the help"
echo " [command] - Execute the specified linux command eg. bash."
}
case "$1" in
app:start)
appStart
;;
app:help)
appHelp
;;
*)
if [ -x $1 ]; then
$1
else
prog=$(which $1)
if [ -n "${prog}" ] ; then
shift 1
$prog $@
else
appHelp
fi
fi
;;
esac
exit 0

File Metadata

Mime Type
text/x-shellscript
Expires
Tue, Feb 3, 04:16 (1 d, 17 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3367733
Default Alt Text
init (1 KB)

Event Timeline