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 | |
khenaidoo | 108f05c | 2017-07-06 11:15:29 -0400 | [diff] [blame] | 3 | while getopts LGC:g:s: option |
Richard Jankowski | 29dd198 | 2017-06-28 13:30:18 -0400 | [diff] [blame] | 4 | do |
| 5 | case "${option}" |
| 6 | in |
| 7 | L) LOOKUP_OPT="-L";; |
khenaidoo | 108f05c | 2017-07-06 11:15:29 -0400 | [diff] [blame] | 8 | G) GLOBAL_REQUEST_OPT="-G";; |
Richard Jankowski | 29dd198 | 2017-06-28 13:30:18 -0400 | [diff] [blame] | 9 | C) CONSUL_OPT="-C ${OPTARG}";; |
| 10 | g) GRPC_OPT="-g ${OPTARG}";; |
| 11 | s) SIM_OPT="-s ${OPTARG}";; |
| 12 | esac |
| 13 | done |
| 14 | |
| 15 | if [ -z "$CONSUL_OPT" ] |
| 16 | then |
| 17 | CONSUL_OPT="-C $DOCKER_HOST_IP:8500" |
| 18 | fi |
| 19 | |
Sergio Slobodrian | ab11c64 | 2017-04-24 07:16:58 -0400 | [diff] [blame] | 20 | echo "export DOCKER_HOST_IP=$DOCKER_HOST_IP" > /home/voltha/.bashrc |
| 21 | echo "export PYTHONPATH=/cli" >> /home/voltha/.bashrc |
| 22 | echo "export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" >> /home/voltha/.bashrc |
| 23 | echo "export DOCKER_HOST_IP=$DOCKER_HOST_IP" > /home/voltha/.bash_profile |
| 24 | echo "export PYTHONPATH=/cli" >> /home/voltha/.bash_profile |
| 25 | echo "export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" >> /home/voltha/.bash_profile |
khenaidoo | 108f05c | 2017-07-06 11:15:29 -0400 | [diff] [blame] | 26 | echo "/cli/cli/main.py $LOOKUP_OPT $GLOBAL_REQUEST_OPT $CONSUL_OPT $GRPC_OPT $SIM_OPT" >> /home/voltha/.bash_profile |
Sergio Slobodrian | ab11c64 | 2017-04-24 07:16:58 -0400 | [diff] [blame] | 27 | echo "logout" >> /home/voltha/.bash_profile |
| 28 | chown voltha.voltha /home/voltha/.bash_profile |
| 29 | /usr/sbin/sshd -D |
| 30 | |