|
| 1 | +#!/bin/bash |
| 2 | + |
| 3 | +# This is the Wowza entrypoint script as of 4.9.7+11; we're disabling |
| 4 | +# the NVIDIA drivers because running ldconfig as an unprivileged user |
| 5 | +# doesn't work. |
| 6 | + |
| 7 | +# Begin Section to map NVIDIA specific libraries for EVA |
| 8 | + |
| 9 | +set -e |
| 10 | + |
| 11 | +log() { |
| 12 | + echo "[entrypoint][$(date '+%Y-%m-%d %H:%M:%S')] $*" >&2 |
| 13 | +} |
| 14 | + |
| 15 | +LIB_DIR="/usr/lib/x86_64-linux-gnu" |
| 16 | + |
| 17 | +if [ -d "$LIB_DIR" ]; then |
| 18 | +# [ -f "${LIB_DIR}/libnvidia-encode.so.1" ] && \ |
| 19 | +# ln -sf "${LIB_DIR}/libnvidia-encode.so.1" "${LIB_DIR}/libnvidia-encode.so" |
| 20 | + |
| 21 | +# [ -f "${LIB_DIR}/libnvcuvid.so.1" ] && \ |
| 22 | +# ln -sf "${LIB_DIR}/libnvcuvid.so.1" "${LIB_DIR}/libnvcuvid.so" |
| 23 | + |
| 24 | +# ldconfig |
| 25 | +# log "NVIDIA symlinks installed, starting original service" |
| 26 | + log "SKIPPING NVIDIA symlinks installation" |
| 27 | + |
| 28 | +fi |
| 29 | + |
| 30 | +# End Section to map NVIDIA specific libraries for EVA |
| 31 | + |
| 32 | +WMSAPP_HOME="$( readlink /usr/local/WowzaStreamingEngine )" |
| 33 | + |
| 34 | +if [ -z $WSE_MGR_USER ]; then |
| 35 | + mgrUser="wowza" |
| 36 | +else |
| 37 | + mgrUser=$WSE_MGR_USER |
| 38 | +fi |
| 39 | +if [ -z $WSE_MGR_PASS ]; then |
| 40 | + mgrPass="wowza" |
| 41 | +else |
| 42 | + mgrPass=$WSE_MGR_PASS |
| 43 | +fi |
| 44 | + |
| 45 | +if [ ! -z $WSE_LIC ]; then |
| 46 | +cat > ${WMSAPP_HOME}/conf/Server.license <<EOF |
| 47 | +-----BEGIN LICENSE----- |
| 48 | +${WSE_LIC} |
| 49 | +-----END LICENSE----- |
| 50 | +EOF |
| 51 | +fi |
| 52 | + |
| 53 | +echo -e "\n$mgrUser $mgrPass admin|advUser\n" >> ${WMSAPP_HOME}/conf/admin.password |
| 54 | +echo -e "\n$mgrUser $mgrPass\n" >> ${WMSAPP_HOME}/conf/publish.password |
| 55 | +echo -e "\n$mgrUser $mgrPass\n" >> ${WMSAPP_HOME}/conf/jmxremote.password |
| 56 | +#echo -e "$mgrUser readwrite\n" >> ${WMSAPP_HOME}/conf/jmxremote.access |
| 57 | + |
| 58 | +if [[ ! -z $WSE_IP_PARAM ]]; then |
| 59 | + #change localhost to some user defined IP |
| 60 | + cat "${WMSAPP_HOME}/conf/Server.xml" > serverTmp |
| 61 | + sed 's|\(<IpAddress>localhost</IpAddress>\)|<IpAddress>'"$WSE_IP_PARAM"'</IpAddress> <!--changed for default install. \1-->|' <serverTmp >Server.xml |
| 62 | + sed 's|\(<RMIServerHostName>localhost</RMIServerHostName>\)|<RMIServerHostName>'"$WSE_IP_PARAM"'</RMIServerHostName> <!--changed for default install. \1-->|' <Server.xml >serverTmp |
| 63 | + cat serverTmp > ${WMSAPP_HOME}/conf/Server.xml |
| 64 | + rm serverTmp Server.xml |
| 65 | + |
| 66 | + cat "${WMSAPP_HOME}/conf/VHost.xml" > vhostTmp |
| 67 | + sed 's|\(<IpAddress>${com.wowza.wms.HostPort.IpAddress}</IpAddress>\)|<IpAddress>'"$WSE_IP_PARAM"'</IpAddress> <!--changed for default cloud install. \1-->|' <vhostTmp >${WMSAPP_HOME}/conf/VHost.xml |
| 68 | + rm vhostTmp |
| 69 | +fi |
| 70 | + |
| 71 | +# Make supervisor log files configurable |
| 72 | +#sed 's|^logfile=.*|logfile='"${SUPERVISOR_LOG_HOME}"'/supervisor/supervisord.log ;|' -i /etc/supervisor/supervisord.conf |
| 73 | + |
| 74 | +exec /usr/bin/supervisord -n -c /etc/supervisor/supervisord.conf |
0 commit comments