#!/bin/bash # Build grideye containers, start all containers, setup networking # Usage: ./startup.sh # Debug: DBG=1 ./startup.sh # See also cleanup.sh >&2 echo "Running script: $0" # include err(), stat() and other functions . ./lib.sh # Turn on debug in containers (restconf, backend) DBG=${DBG:-1} CONFIG0=$(cat < /usr/local/etc/example.xml *:* /usr/local/share/clixon clixon-example example /usr/local/lib/example/backend /usr/local/lib/example/netconf /usr/local/lib/example/restconf /usr/local/lib/example/cli /usr/local/lib/example/clispec /usr/local/var/example/example.sock /usr/local/var/example/example.pidfile 1 VARS /usr/local/var/example /usr/local/lib/xmldb/text.so 0 init disabled EOF ) CONFIG=${CONFIG:-$CONFIG0} STORE=${STORE:-} # Start clixon-example backend # -p 4535 to access via cli from host >&2 echo -n "Starting Backend..." sudo docker run -p 80:80 --rm -e DBG=$DBG -e CONFIG="$CONFIG" -e STORE="$STORE" -td clixon/clixon-system || err "Error starting clixon-system" >&2 echo "clixon-system started" name=clixon/clixon-system ps=$(sudo docker ps -f ancestor=$name|tail -n +2|grep $name|awk '{print $1}') echo "sudo docker exec -it $ps clixon_cli # example command"