copy configuration to /etc/nginx and exit
This commit is contained in:
parent
7376a1abe7
commit
0479563690
4
.vscode/numbered-bookmarks.json
vendored
4
.vscode/numbered-bookmarks.json
vendored
@ -6,13 +6,13 @@
|
|||||||
-1,
|
-1,
|
||||||
19,
|
19,
|
||||||
54,
|
54,
|
||||||
787,
|
819,
|
||||||
68,
|
68,
|
||||||
-1,
|
-1,
|
||||||
-1,
|
-1,
|
||||||
-1,
|
-1,
|
||||||
-1,
|
-1,
|
||||||
-1
|
810
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
32
setup.sh
32
setup.sh
@ -784,6 +784,38 @@ fi
|
|||||||
echo -e "${ok}...files updated${norm}"
|
echo -e "${ok}...files updated${norm}"
|
||||||
echo -e "${mag}---------------------${norm}\n"
|
echo -e "${mag}---------------------${norm}\n"
|
||||||
|
|
||||||
|
### copy configDir to actual nginx directory after backup
|
||||||
|
## backup nginx directory
|
||||||
|
echo -e "${cyan}Backing up NGINX configuration directory${norm}"
|
||||||
|
echo "copying /etc/nginx --> /etc/nginx.original"
|
||||||
|
cp -f -R /etc/nginx /etc/nginx.original
|
||||||
|
copysuccess=$?
|
||||||
|
# verify new directory created
|
||||||
|
if [ "${copysuccess}" -eq 0 ]; then
|
||||||
|
echo -e "${ok}--- configuration backup successful ---"
|
||||||
|
else
|
||||||
|
echo -e "\n${err}Unable to backup existing NGINX configuration${norm}"
|
||||||
|
echo -e "Updated configuration has been copied to ${warn}${configPath}${norm}"
|
||||||
|
echo -e "but must be manually integrated into ${warn}'/etc/nginx/'${norm}."
|
||||||
|
echo "Is this a permissions error?"
|
||||||
|
echo -e "\n${err}Exiting now.${norm}"
|
||||||
|
exit 101
|
||||||
|
fi
|
||||||
|
echo -e "${cyan}Integrating updated configuration...${norm}"
|
||||||
|
echo "(any errors should appear below)"
|
||||||
|
## remove un-needed and/or existing directories and files
|
||||||
|
rm -rf /etc/nginx/conf.d
|
||||||
|
rm -rf /etc/nginx/enabledSites
|
||||||
|
mv -f /etc/nginx/fastcgi_params /etc/nginx/fastcgi_params.original
|
||||||
|
mv -f /etc/nginx/nginx.conf /etc/nginx/nginx.conf.original
|
||||||
|
cp -f -R "${configPath}"/nginx/* /etc/nginx/
|
||||||
|
mkdir /etc/nginx/enabledSites
|
||||||
|
mkdir /etc/nginx/conf.d/enabled
|
||||||
|
echo -e "${ok}...integration completed${norm}"
|
||||||
|
echo -e "${mag}---------------------${norm}\n"
|
||||||
|
echo -e "${ok}Setup script completed${norm}"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# debug section
|
# debug section
|
||||||
echo -e "\n${mag}---------------------${norm}"
|
echo -e "\n${mag}---------------------${norm}"
|
||||||
|
Loading…
Reference in New Issue
Block a user