-
Notifications
You must be signed in to change notification settings - Fork 0
/
common.sh
34 lines (29 loc) · 834 Bytes
/
common.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
LOG_FILE=/var/tmp/install.log
PRINT(){
echo &>> $LOG_FILE
echo &>> $LOG_FILE
echo "####################### $* ##########################" &>> $LOG_FILE
echo $*
}
# install golang
PRINT Installing golang
goLang(){
sudo dnf install ${library} -y &>> $LOG_FILE
go version
}
# install nginx
installNginx(){
PRINT updating dnf-utils
sudo dnf update -y &>>$LOG_FILE
sudo dnf install dnf-utils -y &>> $LOG_FILE
#copy repo file
PRINT copying nginx-repo
cp ${library}.repo /etc/yum.repos.d/${library}.repo &>> $LOG_FILE
#install nginx
PRINT Installing nginx
sudo dnf config-manager --set-enabled ${library}-mainline &>> $LOG_FILE
sudo dnf install ${library} -y &>> $LOG_FILE
sudo systemctl enable ${library} &>> $LOG_FILE
sudo systemctl start ${library} &>> $LOG_FILE
sudo systemctl status ${library} &>> $LOG_FILE
}