blob: ee0a643c635d4f48744d583645299303251b9a37 [file] [log] [blame]
Sergio Slobodrianab11c642017-04-24 07:16:58 -04001#!/bin/bash
Richard Jankowski29dd1982017-06-28 13:30:18 -04002
3while getopts LC:g:s: option
4do
5 case "${option}"
6 in
7 L) LOOKUP_OPT="-L";;
8 C) CONSUL_OPT="-C ${OPTARG}";;
9 g) GRPC_OPT="-g ${OPTARG}";;
10 s) SIM_OPT="-s ${OPTARG}";;
11 esac
12done
13
14if [ -z "$CONSUL_OPT" ]
15then
16 CONSUL_OPT="-C $DOCKER_HOST_IP:8500"
17fi
18
Sergio Slobodrianab11c642017-04-24 07:16:58 -040019echo "export DOCKER_HOST_IP=$DOCKER_HOST_IP" > /home/voltha/.bashrc
20echo "export PYTHONPATH=/cli" >> /home/voltha/.bashrc
21echo "export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" >> /home/voltha/.bashrc
22echo "export DOCKER_HOST_IP=$DOCKER_HOST_IP" > /home/voltha/.bash_profile
23echo "export PYTHONPATH=/cli" >> /home/voltha/.bash_profile
24echo "export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" >> /home/voltha/.bash_profile
Richard Jankowski29dd1982017-06-28 13:30:18 -040025echo "/cli/cli/main.py $LOOKUP_OPT $CONSUL_OPT $GRPC_OPT $SIM_OPT" >> /home/voltha/.bash_profile
Sergio Slobodrianab11c642017-04-24 07:16:58 -040026echo "logout" >> /home/voltha/.bash_profile
27chown voltha.voltha /home/voltha/.bash_profile
28/usr/sbin/sshd -D
29