Revert "smaller fixes (#460)" (#461)

This reverts commit fbb5454cb2.
This commit is contained in:
Daniel Hansson 2018-02-07 21:16:35 +01:00 committed by GitHub
parent fbb5454cb2
commit 16a2d28ae5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 45 additions and 30 deletions

View File

@ -14,7 +14,11 @@ DEBUG=0
debug_mode
# Check if root
root_check
if ! is_root
then
printf "\n${Red}Sorry, you are not root.\n${Color_Off}You must type: ${Cyan}sudo ${Color_Off}bash $SCRIPTS/collabora.sh\n"
exit 1
fi
# Test RAM size (2GB min) + CPUs (min 2)
ram_check 2 Collabora
@ -23,13 +27,13 @@ cpu_check 2 Collabora
# Check if Onlyoffice is running
if [ -d "$NCPATH"/apps/onlyoffice ]
then
msg_box "It seems like OnlyOffice is running.
You can't run OnlyOffice at the same time as you run Collabora."
echo "It seems like OnlyOffice is running."
echo "You can't run OnlyOffice at the same time as you run Collabora."
exit 1
fi
# Notification
msg_box "Before you start, please make sure that port 443 is directly forwarded to this machine!"
whiptail --msgbox "Please before you start, make sure that port 443 is directly forwarded to this machine!" "$WT_HEIGHT" "$WT_WIDTH"
# Get the latest packages
apt update -q4 & spinner_loading
@ -38,15 +42,17 @@ apt update -q4 & spinner_loading
echo "Checking if Nextcloud is installed..."
if ! curl -s https://"${NCDOMAIN//\\/}"/status.php | grep -q 'installed":true'
then
msg_box "It seems like Nextcloud is not installed or that you don't use https on:
${NCDOMAIN//\\/}.
Please install Nextcloud and make sure your domain is reachable, or activate SSL
on your domain to be able to run this script.
If you use the Nextcloud VM you can use the Let's Encrypt script to get SSL and activate your Nextcloud domain.
When SSL is activated, run these commands from your terminal:
sudo wget $APP/collabora.sh
sudo bash collabora.sh"
echo
echo "It seems like Nextcloud is not installed or that you don't use https on:"
echo "${NCDOMAIN//\\/}."
echo "Please install Nextcloud and make sure your domain is reachable, or activate SSL"
echo "on your domain to be able to run this script."
echo
echo "If you use the Nextcloud VM you can use the Let's Encrypt script to get SSL and activate your Nextcloud domain."
echo "When SSL is activated, run these commands from your terminal:"
echo "sudo wget $APP/collabora.sh"
echo "sudo bash collabora.sh"
any_key "Press any key to continue... "
exit 1
fi
@ -62,8 +68,9 @@ elif curl -s -k -m 10 "$SUBDOMAIN"; then
elif curl -s -k -m 10 "https://$SUBDOMAIN" -o /dev/null; then
sleep 0.1
else
msg_box "Nope, it's not there. You have to create $SUBDOMAIN and point
it to this server before you can run this script."
echo "Nope, it's not there. You have to create $SUBDOMAIN and point"
echo "it to this server before you can run this script."
any_key "Press any key to continue... "
exit 1
fi

View File

@ -14,7 +14,11 @@ DEBUG=0
debug_mode
# Check if root
root_check
if ! is_root
then
printf "\n${Red}Sorry, you are not root.\n${Color_Off}You must type: ${Cyan}sudo ${Color_Off}bash $SCRIPTS/onlyoffice.sh\n"
exit 1
fi
# Test RAM size (4GB min) + CPUs (min 2)
ram_check 4 OnlyOffice
@ -23,13 +27,13 @@ cpu_check 2 OnlyOffice
# Check if Collabora is running
if [ -d "$NCPATH"/apps/richdocuments ]
then
msg_box "It seems like Collabora is running.
You can't run Collabora at the same time as you run OnlyOffice."
echo "It seems like Collabora is running."
echo "You can't run Collabora at the same time as you run OnlyOffice."
exit 1
fi
# Notification
msg_box "Before you start, please make sure that port 443 is directly forwarded to this machine!"
whiptail --msgbox "Please before you start, make sure that port 443 is directly forwarded to this machine!" "$WT_HEIGHT" "$WT_WIDTH"
# Get the latest packages
apt update -q4 & spinner_loading
@ -38,14 +42,17 @@ apt update -q4 & spinner_loading
echo "Checking if Nextcloud is installed..."
if ! curl -s https://"${NCDOMAIN//\\/}"/status.php | grep -q 'installed":true'
then
msg_box "It seems like Nextcloud is not installed or that you don't use https on:
${NCDOMAIN//\\/}.
Please install Nextcloud and make sure your domain is reachable, or activate SSL
on your domain to be able to run this script.
If you use the Nextcloud VM you can use the Let's Encrypt script to get SSL and activate your Nextcloud domain.
When SSL is activated, run these commands from your terminal:
sudo wget $APP/onlyoffice.sh
sudo bash onlyoffice.sh"
echo
echo "It seems like Nextcloud is not installed or that you don't use https on:"
echo "${NCDOMAIN//\\/}."
echo "Please install Nextcloud and make sure your domain is reachable, or activate SSL"
echo "on your domain to be able to run this script."
echo
echo "If you use the Nextcloud VM you can use the Let's Encrypt script to get SSL and activate your Nextcloud domain."
echo "When SSL is activated, run these commands from your terminal:"
echo "sudo wget $APP/onlyoffice.sh"
echo "sudo bash onlyoffice.sh"
any_key "Press any key to continue... "
exit 1
fi
@ -61,8 +68,9 @@ elif curl -s -k -m 10 "$SUBDOMAIN"; then
elif curl -s -k -m 10 "https://$SUBDOMAIN" -o /dev/null; then
sleep 0.1
else
msg_box "Nope, it's not there. You have to create $SUBDOMAIN and point
it to this server before you can run this script."
echo "Nope, it's not there. You have to create $SUBDOMAIN and point"
echo "it to this server before you can run this script."
any_key "Press any key to continue... "
exit 1
fi

2
lib.sh
View File

@ -39,7 +39,7 @@ ISSUES="https://github.com/nextcloud/vm/issues"
# User information
NCPASS=nextcloud
NCUSER=ncadmin
UNIXUSER="$(getent group sudo | cut -d: -f4 | cut -d, -f1)"
UNIXUSER=$SUDO_USER
UNIXUSER_PROFILE="/home/$UNIXUSER/.bash_profile"
ROOT_PROFILE="/root/.bash_profile"
# MARIADB