add possibility to skip libraries download
This commit is contained in:
parent
cab4e51b37
commit
57adc2d073
1 changed files with 52 additions and 23 deletions
|
|
@ -350,16 +350,30 @@ done
|
||||||
if [[ $LOCALHOST ]]
|
if [[ $LOCALHOST ]]
|
||||||
then
|
then
|
||||||
echo
|
echo
|
||||||
echo -e "${GREEN}Since, you are on localhost, I try to add \"127.0.0.1 ${WEBSITENAME}\" to /etc/hosts."
|
echo -e "${YELLOW}Since, you are on localhost, I try to add \"127.0.0.1 ${WEBSITENAME}\" to /etc/hosts."
|
||||||
if grep -q "${WEBSITENAME}" "/etc/hosts";
|
echo -e "Is this okay for you?${NC}"
|
||||||
then
|
|
||||||
echo
|
while true; do
|
||||||
echo -e "${RED}Entry \"127.0.0.1 ${WEBSITENAME}\" already in /etc/hosts"
|
read -p "(y/n): " SURE
|
||||||
else
|
case $SURE in
|
||||||
echo
|
[Yy]* )
|
||||||
echo -e "${YELLOW}ADD $WEBSITENAME to /etc/hosts, because you are on a localhost!"
|
if grep -q "${WEBSITENAME}" "/etc/hosts"; then
|
||||||
echo "127.0.0.1 ${WEBSITENAME}" >> /etc/hosts
|
echo
|
||||||
fi
|
echo -e "${RED}Entry \"127.0.0.1 ${WEBSITENAME}\" already in /etc/hosts"
|
||||||
|
else
|
||||||
|
echo
|
||||||
|
echo -e "${YELLOW}ADD $WEBSITENAME to /etc/hosts, because you are on a localhost!"
|
||||||
|
echo "127.0.0.1 ${WEBSITENAME}" >> /etc/hosts
|
||||||
|
fi
|
||||||
|
EDITEDHOSTS=true
|
||||||
|
break;;
|
||||||
|
[Nn]* )
|
||||||
|
echo -e "${GREEN}Okay, to visit your website later on, you have to type http://localhost/${WEBSITENAME}";
|
||||||
|
break;;
|
||||||
|
* ) echo "Please answer yes or no.";;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo
|
echo
|
||||||
|
|
@ -390,7 +404,7 @@ while true; do
|
||||||
case $WRITECONFIG in
|
case $WRITECONFIG in
|
||||||
[Yy]* )
|
[Yy]* )
|
||||||
echo -e "${GREEN}Write config to \"/etc/apache2/sites-available/${WEBSITENAME}\"";
|
echo -e "${GREEN}Write config to \"/etc/apache2/sites-available/${WEBSITENAME}\"";
|
||||||
echo "$SITECONFIG" > /etc/apache2/sites-available/${WEBSITENAME};
|
echo "$SITECONFIG" > /etc/apache2/sites-available/${WEBSITENAME}.conf;
|
||||||
echo -e "${GREEN}Enable site ${WEBSITENAME}${NC}";
|
echo -e "${GREEN}Enable site ${WEBSITENAME}${NC}";
|
||||||
a2ensite ${WEBSITENAME};
|
a2ensite ${WEBSITENAME};
|
||||||
echo -e "${GREEN}Restart apache server${NC}";
|
echo -e "${GREEN}Restart apache server${NC}";
|
||||||
|
|
@ -616,18 +630,31 @@ cd /var/www/html/$WEBSITENAME
|
||||||
|
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo -e "${GREEN}Get necessary libraries.${NC}"
|
echo -e "${YELLOW}Do you like to get colorbox and mirador libraries?${NC}"
|
||||||
echo
|
echo
|
||||||
mkdir -p web/libraries
|
|
||||||
## get colorbox
|
|
||||||
|
|
||||||
wget https://github.com/jackmoore/colorbox/archive/refs/heads/master.zip -P web/libraries/
|
while true; do
|
||||||
unzip web/libraries/master.zip -d web/libraries/
|
read -p "(y/n): " INSTALLCOMPOSER
|
||||||
mv web/libraries/colorbox-master web/libraries/colorbox
|
case ${INSTALLCOMPOSER} in
|
||||||
## get mirador
|
[Yy]* )
|
||||||
|
mkdir -p web/libraries
|
||||||
wget http://wisskieu.nasarek.org/sites/default/files/assets/mirador.zip -P web/libraries/
|
## get colorbox
|
||||||
unzip web/libraries/mirador.zip -d web/libraries/
|
wget https://github.com/jackmoore/colorbox/archive/refs/heads/master.zip -P web/libraries/
|
||||||
|
unzip web/libraries/master.zip -d web/libraries/
|
||||||
|
mv web/libraries/colorbox-master web/libraries/colorbox
|
||||||
|
## get mirador
|
||||||
|
wget http://wisskieu.nasarek.org/sites/default/files/assets/mirador.zip -P web/libraries/
|
||||||
|
unzip web/libraries/mirador.zip -d web/libraries/
|
||||||
|
break;;
|
||||||
|
[Nn]* )
|
||||||
|
echo -e "${GREEN}Okay, you can download it later from:"
|
||||||
|
echo -e "https://github.com/jackmoore/colorbox/archive/refs/heads/master.zip"
|
||||||
|
echo -e "and"
|
||||||
|
echo -e "http://wisskieu.nasarek.org/sites/default/files/assets/mirador.zip${NC}"
|
||||||
|
break;;
|
||||||
|
* ) echo "Please answer y[es] or n[o].";;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
#echo change permissions for webroot to www-data
|
#echo change permissions for webroot to www-data
|
||||||
|
|
||||||
|
|
@ -695,6 +722,8 @@ if [[ ! ${LOCALHOST} ]]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo -e "${GREEN}Thats it! You can now visit http://${WEBSITENAME} and install Drupal!${NC}"
|
if [[ ${EDITEDHOSTS} ]]; then
|
||||||
|
echo -e "${GREEN}Thats it! You can now visit http://${WEBSITENAME} or and install Drupal!${NC}"
|
||||||
|
else
|
||||||
|
echo -e "${GREEN}Thats it! You can now visit http://localhost/${WEBSITENAME} or and install Drupal!${NC}"
|
||||||
exit 0;
|
exit 0;
|
||||||
Loading…
Add table
Add a link
Reference in a new issue