#!/bin/bash export DEBUG="1" #export uname="bus" export uname="root" export mountdir="$1" export SSH_DEFAULT_PORT="6055" export AVLS_DAEMON_PORT="2857" export PASSDB_DAEMON_PORT="7277" export BILLDB_DAEMON_PORT="2455" export HELLO_DAEMON_PORT="3556" export UPDATE_DAEMON_PORT="8377" export DEBUG_PORT="5000" export mountparam="" if [[ "$mountdir" != "" ]] ; then mountparam="-v $mountdir:/data" echo "$mountparam" fi ## for interactive debugging... ## if [[ "$uname" == "root" ]] ; then if [[ "$DEBUG" == "1" ]] ; then docker run $mountparam \ -p $DEBUG_PORT:$DEBUG_PORT \ -p 8080:80 \ -p 4430:443 \ -p $SSH_DEFAULT_PORT:22 \ -p $AVLS_DAEMON_PORT:$AVLS_DAEMON_PORT \ -p $PASSDB_DAEMON_PORT:$PASSDB_DAEMON_PORT \ -p $BILLDB_DAEMON_PORT:$BILLDB_DAEMON_PORT \ -p $HELLO_DAEMON_PORT:$HELLO_DAEMON_PORT \ -p $UPDATE_DAEMON_PORT:$UPDATE_DAEMON_PORT \ -it popufare \ /bin/bash else docker run \ -p 8080:80 \ -p 4430:443 \ -p $SSH_DEFAULT_PORT:22 \ -p $AVLS_DAEMON_PORT:$AVLS_DAEMON_PORT \ -p $PASSDB_DAEMON_PORT:$PASSDB_DAEMON_PORT \ -p $BILLDB_DAEMON_PORT:$BILLDB_DAEMON_PORT \ -p $HELLO_DAEMON_PORT:$HELLO_DAEMON_PORT \ -p $UPDATE_DAEMON_PORT:$UPDATE_DAEMON_PORT \ -it popufare \ /bin/bash fi else docker run $mountparam \ -p 8080:80 \ -p 4430:443 \ -p $SSH_DEFAULT_PORT:22 \ -p $AVLS_DAEMON_PORT:$AVLS_DAEMON_PORT \ -p $PASSDB_DAEMON_PORT:$PASSDB_DAEMON_PORT \ -p $BILLDB_DAEMON_PORT:$BILLDB_DAEMON_PORT \ -p $HELLO_DAEMON_PORT:$HELLO_DAEMON_PORT \ -p $UPDATE_DAEMON_PORT:$UPDATE_DAEMON_PORT \ -it popufare \ bash -c " service ssh start && su - bus " fi