Fix typo error and timeout error
[vfc/nfvo/driver/sfc.git] / zte / sfc-driver / plugin-standalone / src / main / assembly / docker / docker-env-config.sh
1 #!/bin/bash
2 install_sf(){
3
4         sed -i 's/enabled=1/enabled=0/' /etc/yum/pluginconf.d/fastestmirror.conf
5         sed -i 's|#baseurl=http://mirror.centos.org/centos|baseurl=http://mirrors.ocf.berkeley.edu/centos|' /etc/yum.repos.d/*.repo
6         yum update -y
7         yum install -y wget unzip socat java-1.8.0-openjdk-headless
8         sed -i 's|#networkaddress.cache.ttl=-1|networkaddress.cache.ttl=10|' /usr/lib/jvm/jre/lib/security/java.security
9
10         # get binary zip from nexus
11         wget -q -O vfc-sfcdriver-zte.zip 'https://nexus.onap.org/service/local/artifact/maven/redirect?r=snapshots&g=org.onap.vfc.nfvo.driver.sfc.zte.sfc-driver-standalone&a=vfc-nfvo-driver-sfc-zte-sfc-driver&v=LATEST&e=zip' && \
12         unzip vfc-sfcdriver-zte.zip && \
13         rm -rf vfc-sfcdriver-zte.zip
14
15         chmod +x *.sh
16         chmod +x docker/*.sh
17 }
18
19 add_user(){
20
21         useradd onap
22         yum -y install sudo
23         chmod u+x /etc/sudoers
24         sed -i '/Same thing without a password/a\onap    ALL=(ALL:ALL) NOPASSWD:ALL' /etc/sudoers
25         chmod u-x /etc/sudoers
26         chown onap:onap -R /service
27 }
28
29 clean_sf_cache(){
30                                                                 
31         yum clean all
32 }
33
34 install_sf
35 wait
36 add_user
37 clean_sf_cache