Sergio Slobodrian | ab11c64 | 2017-04-24 07:16:58 -0400 | [diff] [blame] | 1 | #!/bin/bash |
Zack Williams | 41513bf | 2018-07-07 20:08:35 -0700 | [diff] [blame] | 2 | # Copyright 2017-present Open Networking Foundation |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
Richard Jankowski | 29dd198 | 2017-06-28 13:30:18 -0400 | [diff] [blame] | 15 | |
khenaidoo | 108f05c | 2017-07-06 11:15:29 -0400 | [diff] [blame] | 16 | while getopts LGC:g:s: option |
Richard Jankowski | 29dd198 | 2017-06-28 13:30:18 -0400 | [diff] [blame] | 17 | do |
| 18 | case "${option}" |
| 19 | in |
| 20 | L) LOOKUP_OPT="-L";; |
khenaidoo | 108f05c | 2017-07-06 11:15:29 -0400 | [diff] [blame] | 21 | G) GLOBAL_REQUEST_OPT="-G";; |
Richard Jankowski | 29dd198 | 2017-06-28 13:30:18 -0400 | [diff] [blame] | 22 | C) CONSUL_OPT="-C ${OPTARG}";; |
| 23 | g) GRPC_OPT="-g ${OPTARG}";; |
| 24 | s) SIM_OPT="-s ${OPTARG}";; |
| 25 | esac |
| 26 | done |
| 27 | |
| 28 | if [ -z "$CONSUL_OPT" ] |
| 29 | then |
| 30 | CONSUL_OPT="-C $DOCKER_HOST_IP:8500" |
| 31 | fi |
| 32 | |
Sergio Slobodrian | ab11c64 | 2017-04-24 07:16:58 -0400 | [diff] [blame] | 33 | echo "export DOCKER_HOST_IP=$DOCKER_HOST_IP" > /home/voltha/.bashrc |
| 34 | echo "export PYTHONPATH=/cli" >> /home/voltha/.bashrc |
| 35 | echo "export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" >> /home/voltha/.bashrc |
| 36 | echo "export DOCKER_HOST_IP=$DOCKER_HOST_IP" > /home/voltha/.bash_profile |
| 37 | echo "export PYTHONPATH=/cli" >> /home/voltha/.bash_profile |
| 38 | 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] | 39 | 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] | 40 | echo "logout" >> /home/voltha/.bash_profile |
| 41 | chown voltha.voltha /home/voltha/.bash_profile |
| 42 | /usr/sbin/sshd -D |
| 43 | |