blob: 218a270d510c2345f4e6335f08d41ffc3f965d24 [file] [log] [blame]
Sergio Slobodrianab11c642017-04-24 07:16:58 -04001#!/bin/bash
Richard Jankowski29dd1982017-06-28 13:30:18 -04002
khenaidoo108f05c2017-07-06 11:15:29 -04003while getopts LGC:g:s: option
Richard Jankowski29dd1982017-06-28 13:30:18 -04004do
5 case "${option}"
6 in
7 L) LOOKUP_OPT="-L";;
khenaidoo108f05c2017-07-06 11:15:29 -04008 G) GLOBAL_REQUEST_OPT="-G";;
Richard Jankowski29dd1982017-06-28 13:30:18 -04009 C) CONSUL_OPT="-C ${OPTARG}";;
10 g) GRPC_OPT="-g ${OPTARG}";;
11 s) SIM_OPT="-s ${OPTARG}";;
12 esac
13done
14
15if [ -z "$CONSUL_OPT" ]
16then
17 CONSUL_OPT="-C $DOCKER_HOST_IP:8500"
18fi
19
Sergio Slobodrianab11c642017-04-24 07:16:58 -040020echo "export DOCKER_HOST_IP=$DOCKER_HOST_IP" > /home/voltha/.bashrc
21echo "export PYTHONPATH=/cli" >> /home/voltha/.bashrc
22echo "export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" >> /home/voltha/.bashrc
23echo "export DOCKER_HOST_IP=$DOCKER_HOST_IP" > /home/voltha/.bash_profile
24echo "export PYTHONPATH=/cli" >> /home/voltha/.bash_profile
25echo "export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" >> /home/voltha/.bash_profile
khenaidoo108f05c2017-07-06 11:15:29 -040026echo "/cli/cli/main.py $LOOKUP_OPT $GLOBAL_REQUEST_OPT $CONSUL_OPT $GRPC_OPT $SIM_OPT" >> /home/voltha/.bash_profile
Sergio Slobodrianab11c642017-04-24 07:16:58 -040027echo "logout" >> /home/voltha/.bash_profile
28chown voltha.voltha /home/voltha/.bash_profile
29/usr/sbin/sshd -D
30