Sergio Slobodrian | ab11c64 | 2017-04-24 07:16:58 -0400 | [diff] [blame] | 1 | #!/bin/bash |
Richard Jankowski | 29dd198 | 2017-06-28 13:30:18 -0400 | [diff] [blame] | 2 | |
| 3 | while getopts LC:g:s: option |
| 4 | do |
| 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 |
| 12 | done |
| 13 | |
| 14 | if [ -z "$CONSUL_OPT" ] |
| 15 | then |
| 16 | CONSUL_OPT="-C $DOCKER_HOST_IP:8500" |
| 17 | fi |
| 18 | |
Sergio Slobodrian | ab11c64 | 2017-04-24 07:16:58 -0400 | [diff] [blame] | 19 | echo "export DOCKER_HOST_IP=$DOCKER_HOST_IP" > /home/voltha/.bashrc |
| 20 | echo "export PYTHONPATH=/cli" >> /home/voltha/.bashrc |
| 21 | echo "export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" >> /home/voltha/.bashrc |
| 22 | echo "export DOCKER_HOST_IP=$DOCKER_HOST_IP" > /home/voltha/.bash_profile |
| 23 | echo "export PYTHONPATH=/cli" >> /home/voltha/.bash_profile |
| 24 | echo "export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" >> /home/voltha/.bash_profile |
Richard Jankowski | 29dd198 | 2017-06-28 13:30:18 -0400 | [diff] [blame] | 25 | echo "/cli/cli/main.py $LOOKUP_OPT $CONSUL_OPT $GRPC_OPT $SIM_OPT" >> /home/voltha/.bash_profile |
Sergio Slobodrian | ab11c64 | 2017-04-24 07:16:58 -0400 | [diff] [blame] | 26 | echo "logout" >> /home/voltha/.bash_profile |
| 27 | chown voltha.voltha /home/voltha/.bash_profile |
| 28 | /usr/sbin/sshd -D |
| 29 | |