Naveen Sampath | 04696f7 | 2022-06-13 15:19:14 +0530 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # |
| 3 | # Copyright 2022-present Open Networking Foundation |
| 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. |
| 15 | #/ |
| 16 | |
| 17 | echo '[ ! -z "$TERM" -a -r /etc/banner ] && cat /etc/issue && cat /etc/banner' \ |
| 18 | >> /etc/bash.bashrc \ |
| 19 | ; echo -e " |
| 20 | ----------------------------------------------------------- |
| 21 | __ _______ _____ _____ _ _____ |
| 22 | \ \ / / ____|/ ____| / ____| | |_ _| |
| 23 | \ \ / / | __| | | | | | | | |
| 24 | \ \/ /| | |_ | | | | | | | | |
| 25 | \ / | |__| | |____ | |____| |____ _| |_ |
| 26 | \/ \_____|\_____| \_____|______|_____| |
| 27 | |
| 28 | ----------------------------------------------------------- |
| 29 | Welcome to VGC-CLI |
| 30 | ----------------------------------------------------------- |
| 31 | |
| 32 | "\ |
| 33 | > /etc/banner |
| 34 | |
| 35 | # ENVIRONMENT VARIABLES |
| 36 | echo "export KAFKA_ADAPTER_HOST=${KAFKA_ADAPTER_HOST}" >> /home/voltha-go-controller/.bash_profile |
| 37 | echo "export KAFKA_ADAPTER_PORT=9092" >> /home/voltha-go-controller/.bash_profile |
| 38 | echo "export KAFKA_CLUSTER_HOST=${KAFKA_CLUSTER_HOST}" >> /home/voltha-go-controller/.bash_profile |
| 39 | echo "export KAFKA_CLUSTER_PORT=9092" >> /home/voltha-go-controller/.bash_profile |
| 40 | echo "export KV_STORE_HOST=${KV_STORE_HOST}" >> /home/voltha-go-controller/.bash_profile |
| 41 | echo "export KV_STORE_PORT=${KV_STORE_PORT}" >> /home/voltha-go-controller/.bash_profile |
| 42 | echo "export KV_STORE_TYPE=redis" >> /home/voltha-go-controller/.bash_profile |
| 43 | echo "export VOLTHA_HOST=${VOLTHA_HOST}" >> /home/voltha-go-controller/.bash_profile |
| 44 | echo "export VOLTHA_PORT=${VOLTHA_PORT}" >> /home/voltha-go-controller/.bash_profile |
| 45 | echo "export KV_STORE_TIMEOUT=10" >> /home/voltha-go-controller/.bash_profile |
| 46 | echo "export BANNER=false" >> /home/voltha-go-controller/.bash_profile |
| 47 | |
| 48 | # ALIAS FOR VGC COMMANDS |
| 49 | echo "alias flows='./vgcctl flows'" >> /home/voltha-go-controller/.bash_profile |
| 50 | echo "alias igmp='./vgcctl igmp'" >> /home/voltha-go-controller/.bash_profile |
| 51 | echo "alias mvlan='./vgcctl mvlan'" >> /home/voltha-go-controller/.bash_profile |
| 52 | echo "alias port='./vgcctl port'" >> /home/voltha-go-controller/.bash_profile |
| 53 | echo "alias service='./vgcctl service'" >> /home/voltha-go-controller/.bash_profile |
| 54 | echo "alias vnet='./vgcctl vnet'" >> /home/voltha-go-controller/.bash_profile |
| 55 | echo "alias vpvs='./vgcctl vpvs'" >> /home/voltha-go-controller/.bash_profile |
| 56 | echo "alias meter='./vgcctl meter'" >> /home/voltha-go-controller/.bash_profile |
| 57 | echo "alias group='./vgcctl group'" >> /home/voltha-go-controller/.bash_profile |
| 58 | echo "alias igmpgroup='./vgcctl igmpgroup'">> /home/voltha-go-controller/.bash_profile |
| 59 | echo "alias igmpchannel='./vgcctl igmpchannel'">> /home/voltha-go-controller/.bash_profile |
| 60 | echo "alias igmpdevice='./vgcctl igmpdevice'">>/home/voltha-go-controller/.bash_profile |
| 61 | echo "alias igmpport='./vgcctl igmpport'">>/home/voltha-go-controller/.bash_profile |
| 62 | echo "alias cacheicmp='./vgcctl cacheicmp'">>/home/voltha-go-controller/.bash_profile |
| 63 | echo "alias cachemvlan='./vgcctl cachemvlan'">>/home/voltha-go-controller/.bash_profile |
| 64 | echo "alias cacheport='./vgcctl cacheport'">>/home/voltha-go-controller/.bash_profile |
| 65 | echo "alias tasklist='./vgcctl tasklist'">>/home/voltha-go-controller/.bash_profile |
| 66 | echo "alias device='./vgcctl device'">>/home/voltha-go-controller/.bash_profile |
| 67 | echo "alias help='./vgcctl --help'">>/home/voltha-go-controller/.bash_profile |
| 68 | echo "alias dhcpsession='./vgcctl dhcpsession'">>/home/voltha-go-controller/.bash_profile |
| 69 | echo "alias ponports='./vgcctl ponports'">>/home/voltha-go-controller/.bash_profile |
| 70 | echo "alias mcast='./vgcctl mcast'" >> /home/voltha-go-controller/.bash_profile |
| 71 | |
| 72 | chown voltha-go-controller.voltha-go-controller /home/voltha-go-controller/.bash_profile |
| 73 | ssh-keygen -A |
| 74 | /usr/sbin/sshd -D & |
| 75 | /home/voltha-go-controller/voltha-go-controller |