replace wget with curl (#812)
Signed-off-by: enoch85 <github@hanssonit.se>
This commit is contained in:
Родитель
71104d5523
Коммит
5f840d5e8f
|
@ -47,7 +47,7 @@ The script will mount and format the drive. Please select Manually Format & Moun
|
||||||
|
|
||||||
#### Installation
|
#### Installation
|
||||||
1. Get the latest install script from master and install it with a sudo user:<br>
|
1. Get the latest install script from master and install it with a sudo user:<br>
|
||||||
`sudo bash -c "$(wget -q -O - https://raw.githubusercontent.com/nextcloud/vm/master/nextcloud_install_production.sh)"`
|
`sudo bash -c "$(curl -sLO https://raw.githubusercontent.com/nextcloud/vm/master/nextcloud_install_production.sh)"`
|
||||||
2. When the VM is installed it will automatically reboot. Remember to login with the user you created:<br>
|
2. When the VM is installed it will automatically reboot. Remember to login with the user you created:<br>
|
||||||
`ssh <user>@IP-ADDRESS`<br>
|
`ssh <user>@IP-ADDRESS`<br>
|
||||||
If it automatically runs as root when you reboot the machine, you have to abort it by pressing `CTRL+C` and run the script as the user you just created:<br>
|
If it automatically runs as root when you reboot the machine, you have to abort it by pressing `CTRL+C` and run the script as the user you just created:<br>
|
||||||
|
@ -160,7 +160,7 @@ Keep asking questions so that we can add them here.
|
||||||
**Q: How to install apps if not selected during first install?**
|
**Q: How to install apps if not selected during first install?**
|
||||||
<br />
|
<br />
|
||||||
**A:** Go to the apps folder in this repo and download the script in raw format and run them. For installing Talk:
|
**A:** Go to the apps folder in this repo and download the script in raw format and run them. For installing Talk:
|
||||||
`wget https://raw.githubusercontent.com/nextcloud/vm/master/apps/talk.sh && sudo bash talk.sh`
|
`curl -sLO https://raw.githubusercontent.com/nextcloud/vm/master/apps/talk.sh && sudo bash talk.sh`
|
||||||
|
|
||||||
**Q: How to continue from partially installed system? - You got the FQDN wrong/You put in a bad password/ etc...**
|
**Q: How to continue from partially installed system? - You got the FQDN wrong/You put in a bad password/ etc...**
|
||||||
<br />
|
<br />
|
||||||
|
|
|
@ -35,8 +35,8 @@ check_distro_version
|
||||||
# Install Adminer
|
# Install Adminer
|
||||||
apt update -q4 & spinner_loading
|
apt update -q4 & spinner_loading
|
||||||
install_if_not adminer
|
install_if_not adminer
|
||||||
sudo wget -q "http://www.adminer.org/latest.php" -O "$ADMINERDIR"/latest.php
|
curl_to_dir "http://www.adminer.org" "latest.php" "$ADMINERDIR"
|
||||||
sudo ln -s "$ADMINERDIR"/latest.php "$ADMINERDIR"/adminer.php
|
ln -s "$ADMINERDIR"/latest.php "$ADMINERDIR"/adminer.php
|
||||||
|
|
||||||
cat << ADMINER_CREATE > "$ADMINER_CONF"
|
cat << ADMINER_CREATE > "$ADMINER_CONF"
|
||||||
Alias /adminer.php $ADMINERDIR/adminer.php
|
Alias /adminer.php $ADMINERDIR/adminer.php
|
||||||
|
|
|
@ -44,20 +44,15 @@ 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.
|
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:
|
When SSL is activated, run these commands from your terminal:
|
||||||
sudo wget $APP/collabora.sh
|
sudo curl -sLO $APP/collabora.sh
|
||||||
sudo bash collabora.sh"
|
sudo bash collabora.sh"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check if $SUBDOMAIN exists and is reachable
|
# Check if $SUBDOMAIN exists and is reachable
|
||||||
print_text_in_color "$ICyan" "Checking if $SUBDOMAIN exists and is reachable..."
|
print_text_in_color "$ICyan" "Checking if $SUBDOMAIN exists and is reachable..."
|
||||||
if wget -q -T 10 -t 2 --spider "$SUBDOMAIN"; then
|
if site_200 "$SUBDOMAIN"
|
||||||
sleep 0.1
|
then
|
||||||
elif wget -q -T 10 -t 2 --spider --no-check-certificate "https://$SUBDOMAIN"; then
|
|
||||||
sleep 0.1
|
|
||||||
elif curl -s -k -m 10 "$SUBDOMAIN"; then
|
|
||||||
sleep 0.1
|
|
||||||
elif curl -s -k -m 10 "https://$SUBDOMAIN" -o /dev/null; then
|
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
else
|
else
|
||||||
msg_box "Nope, it's not there. You have to create $SUBDOMAIN and point
|
msg_box "Nope, it's not there. You have to create $SUBDOMAIN and point
|
||||||
|
|
|
@ -43,20 +43,15 @@ Please install Nextcloud and make sure your domain is reachable, or activate SSL
|
||||||
on your domain to be able to run this script.
|
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.
|
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:
|
When SSL is activated, run these commands from your terminal:
|
||||||
sudo wget $APP/onlyoffice.sh
|
sudo curl -sLO $APP/onlyoffice.sh
|
||||||
sudo bash onlyoffice.sh"
|
sudo bash onlyoffice.sh"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check if $SUBDOMAIN exists and is reachable
|
# Check if $SUBDOMAIN exists and is reachable
|
||||||
print_text_in_color "$ICyan" "Checking if $SUBDOMAIN exists and is reachable..."
|
print_text_in_color "$ICyan" "Checking if $SUBDOMAIN exists and is reachable..."
|
||||||
if wget -q -T 10 -t 2 --spider "$SUBDOMAIN"; then
|
if site_200 "$SUBDOMAIN"
|
||||||
sleep 0.1
|
then
|
||||||
elif wget -q -T 10 -t 2 --spider --no-check-certificate "https://$SUBDOMAIN"; then
|
|
||||||
sleep 0.1
|
|
||||||
elif curl -s -k -m 10 "$SUBDOMAIN"; then
|
|
||||||
sleep 0.1
|
|
||||||
elif curl -s -k -m 10 "https://$SUBDOMAIN" -o /dev/null; then
|
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
else
|
else
|
||||||
msg_box "Nope, it's not there. You have to create $SUBDOMAIN and point
|
msg_box "Nope, it's not there. You have to create $SUBDOMAIN and point
|
||||||
|
|
|
@ -34,7 +34,7 @@ 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.
|
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:
|
When SSL is activated, run these commands from your terminal:
|
||||||
sudo wget $APP/talk.sh
|
sudo curl -sLO $APP/talk.sh
|
||||||
sudo bash talk.sh"
|
sudo bash talk.sh"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
@ -125,7 +125,7 @@ msg_box "You have to open $TURN_PORT TCP/UDP in your firewall or your TURN/STUN
|
||||||
After you hit OK the script will check for the firewall and eventually exit on failure.
|
After you hit OK the script will check for the firewall and eventually exit on failure.
|
||||||
|
|
||||||
To run again the setup, after fixing your firewall:
|
To run again the setup, after fixing your firewall:
|
||||||
sudo wget $APP/talk.sh
|
sudo -sLO $APP/talk.sh
|
||||||
sudo bash talk.sh"
|
sudo bash talk.sh"
|
||||||
|
|
||||||
# Check if the port is open
|
# Check if the port is open
|
||||||
|
|
|
@ -23,7 +23,7 @@ apt install -y zip perl libnet-ssleay-perl openssl libauthen-pam-perl libpam-run
|
||||||
|
|
||||||
# Install Webmin
|
# Install Webmin
|
||||||
sed -i '$a deb http://download.webmin.com/download/repository sarge contrib' /etc/apt/sources.list
|
sed -i '$a deb http://download.webmin.com/download/repository sarge contrib' /etc/apt/sources.list
|
||||||
if wget -q http://www.webmin.com/jcameron-key.asc -O- | sudo apt-key add -
|
if curl -fsSL http://www.webmin.com/jcameron-key.asc | sudo apt-key add -
|
||||||
then
|
then
|
||||||
apt update -q4 & spinner_loading
|
apt update -q4 & spinner_loading
|
||||||
apt install webmin -y
|
apt install webmin -y
|
||||||
|
|
|
@ -91,14 +91,9 @@ check_command download_le_script test-new-config
|
||||||
# Check if $domain exists and is reachable
|
# Check if $domain exists and is reachable
|
||||||
echo
|
echo
|
||||||
print_text_in_color "$ICyan" "Checking if $domain exists and is reachable..."
|
print_text_in_color "$ICyan" "Checking if $domain exists and is reachable..."
|
||||||
if wget -q -T 10 -t 2 --spider "$domain"; then
|
if site_200 "$domain"
|
||||||
sleep 1
|
then
|
||||||
elif wget -q -T 10 -t 2 --spider --no-check-certificate "https://$domain"; then
|
sleep 0.1
|
||||||
sleep 1
|
|
||||||
elif curl -s -k -m 10 "$domain"; then
|
|
||||||
sleep 1
|
|
||||||
elif curl -s -k -m 10 "https://$domain" -o /dev/null ; then
|
|
||||||
sleep 1
|
|
||||||
else
|
else
|
||||||
msg_box "Nope, it's not there. You have to create $domain and point
|
msg_box "Nope, it's not there. You have to create $domain and point
|
||||||
it to this server before you can run this script."
|
it to this server before you can run this script."
|
||||||
|
|
65
lib.sh
65
lib.sh
|
@ -23,7 +23,6 @@ DISTRO=$(lsb_release -sd | cut -d ' ' -f 2)
|
||||||
IFACE2=$(ip -o link show | awk '{print $2,$9}' | grep 'UP' | cut -d ':' -f 1)
|
IFACE2=$(ip -o link show | awk '{print $2,$9}' | grep 'UP' | cut -d ':' -f 1)
|
||||||
[ ! -z "$CHECK_CURRENT_REPO" ] && REPO=$(apt-get update | grep -m 1 Hit | awk '{ print $2}')
|
[ ! -z "$CHECK_CURRENT_REPO" ] && REPO=$(apt-get update | grep -m 1 Hit | awk '{ print $2}')
|
||||||
ADDRESS=$(hostname -I | cut -d ' ' -f 1)
|
ADDRESS=$(hostname -I | cut -d ' ' -f 1)
|
||||||
WGET="/usr/bin/wget"
|
|
||||||
# WANIP4=$(dig +short myip.opendns.com @resolver1.opendns.com) # as an alternative
|
# WANIP4=$(dig +short myip.opendns.com @resolver1.opendns.com) # as an alternative
|
||||||
WANIP4=$(curl -s -k -m 5 https://ipv4bot.whatismyipaddress.com)
|
WANIP4=$(curl -s -k -m 5 https://ipv4bot.whatismyipaddress.com)
|
||||||
[ ! -z "$LOAD_IP6" ] && WANIP6=$(curl -s -k -m 5 https://ipv6bot.whatismyipaddress.com)
|
[ ! -z "$LOAD_IP6" ] && WANIP6=$(curl -s -k -m 5 https://ipv6bot.whatismyipaddress.com)
|
||||||
|
@ -197,6 +196,24 @@ do
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Checks if site is reachable with a HTTP 200 status
|
||||||
|
site_200() {
|
||||||
|
if [[ "$(curl -sfIL --retry 3 "$1" | grep Status: | awk '{print$2}')" -eq 200 ]]
|
||||||
|
then
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# A function to fetch a file with curl to a directory
|
||||||
|
# 1 = https://example.com
|
||||||
|
# 2 = name of file
|
||||||
|
# 3 = directory that the file should end up in
|
||||||
|
curl_to_dir() {
|
||||||
|
check_command curl -sSL "$1"/"$2" -o "$3"/"$2"
|
||||||
|
}
|
||||||
|
|
||||||
start_if_stopped() {
|
start_if_stopped() {
|
||||||
if ! pgrep "$1"
|
if ! pgrep "$1"
|
||||||
then
|
then
|
||||||
|
@ -619,13 +636,7 @@ network_ok() {
|
||||||
then
|
then
|
||||||
service networking restart > /dev/null
|
service networking restart > /dev/null
|
||||||
fi
|
fi
|
||||||
sleep 2
|
sleep 5 && site_200 github.com
|
||||||
if wget -q -T 20 -t 2 http://github.com -O /dev/null & spinner_loading
|
|
||||||
then
|
|
||||||
return 0
|
|
||||||
else
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Whiptail auto-size
|
# Whiptail auto-size
|
||||||
|
@ -672,9 +683,9 @@ fi
|
||||||
|
|
||||||
download_verify_nextcloud_stable() {
|
download_verify_nextcloud_stable() {
|
||||||
rm -f "$HTML/$STABLEVERSION.tar.bz2"
|
rm -f "$HTML/$STABLEVERSION.tar.bz2"
|
||||||
wget -q -T 10 -t 2 "$NCREPO/$STABLEVERSION.tar.bz2" -P "$HTML"
|
curl_to_dir "$NCREPO" "$STABLEVERSION.tar.bz2" "$HTML"
|
||||||
mkdir -p "$GPGDIR"
|
mkdir -p "$GPGDIR"
|
||||||
wget -q "$NCREPO/$STABLEVERSION.tar.bz2.asc" -P "$GPGDIR"
|
curl_to_dir "$NCREPO" "$STABLEVERSION.tar.bz2.asc" "$GPGDIR"
|
||||||
chmod -R 600 "$GPGDIR"
|
chmod -R 600 "$GPGDIR"
|
||||||
gpg --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys "$OpenPGP_fingerprint"
|
gpg --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys "$OpenPGP_fingerprint"
|
||||||
gpg --verify "$GPGDIR/$STABLEVERSION.tar.bz2.asc" "$HTML/$STABLEVERSION.tar.bz2"
|
gpg --verify "$GPGDIR/$STABLEVERSION.tar.bz2.asc" "$HTML/$STABLEVERSION.tar.bz2"
|
||||||
|
@ -687,9 +698,9 @@ rm -f releases
|
||||||
download_static_script() {
|
download_static_script() {
|
||||||
# Get ${1} script
|
# Get ${1} script
|
||||||
rm -f "${SCRIPTS}/${1}.sh" "${SCRIPTS}/${1}.php" "${SCRIPTS}/${1}.py"
|
rm -f "${SCRIPTS}/${1}.sh" "${SCRIPTS}/${1}.php" "${SCRIPTS}/${1}.py"
|
||||||
if ! { wget -q "${STATIC}/${1}.sh" -P "$SCRIPTS" || wget -q "${STATIC}/${1}.php" -P "$SCRIPTS" || wget -q "${STATIC}/${1}.py" -P "$SCRIPTS"; }
|
if ! { curl_to_dir "${STATIC}" "${1}.sh" "$SCRIPTS" || curl_to_dir "${STATIC}" "${1}.php" "$SCRIPTS" || curl_to_dir "${STATIC}" "${1}.py" "$SCRIPTS"; }
|
||||||
then
|
then
|
||||||
print_text_in_color "$Red" "{$1} failed to download. Please run: 'sudo wget ${STATIC}/${1}.sh|.php|.py' again."
|
print_text_in_color "$Red" "{$1} failed to download. Please run: 'sudo curl -sLO ${STATIC}/${1}.sh|.php|.py' again."
|
||||||
print_text_in_color "$ICyan" "If you get this error when running the nextcloud-startup-script then just re-run it with:"
|
print_text_in_color "$ICyan" "If you get this error when running the nextcloud-startup-script then just re-run it with:"
|
||||||
print_text_in_color "$ICyan" "'sudo bash $SCRIPTS/nextcloud-startup-script.sh' and all the scripts will be downloaded again"
|
print_text_in_color "$ICyan" "'sudo bash $SCRIPTS/nextcloud-startup-script.sh' and all the scripts will be downloaded again"
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -701,9 +712,9 @@ download_static_script() {
|
||||||
download_le_script() {
|
download_le_script() {
|
||||||
# Get ${1} script
|
# Get ${1} script
|
||||||
rm -f "${SCRIPTS}/${1}.sh" "${SCRIPTS}/${1}.php" "${SCRIPTS}/${1}.py"
|
rm -f "${SCRIPTS}/${1}.sh" "${SCRIPTS}/${1}.php" "${SCRIPTS}/${1}.py"
|
||||||
if ! { wget -q "${LETS_ENC}/${1}.sh" -P "$SCRIPTS" || wget -q "${LETS_ENC}/${1}.php" -P "$SCRIPTS" || wget -q "${LETS_ENC}/${1}.py" -P "$SCRIPTS"; }
|
if ! { curl_to_dir "${LETS_ENC}" "${1}.sh" "$SCRIPTS" || curl_to_dir "${LETS_ENC}" "${1}.php" "$SCRIPTS" || curl_to_dir "${LETS_ENC}" "${1}.py" "$SCRIPTS"; }
|
||||||
then
|
then
|
||||||
print_text_in_color "$Red" "{$1} failed to download. Please run: 'sudo wget ${STATIC}/${1}.sh|.php|.py' again."
|
print_text_in_color "$Red" "{$1} failed to download. Please run: 'sudo curl -sLO ${STATIC}/${1}.sh|.php|.py' again."
|
||||||
print_text_in_color "$ICyan" "If you get this error when running the nextcloud-startup-script then just re-run it with:"
|
print_text_in_color "$ICyan" "If you get this error when running the nextcloud-startup-script then just re-run it with:"
|
||||||
print_text_in_color "$ICyan" "'sudo bash $SCRIPTS/nextcloud-startup-script.sh' and all the scripts will be downloaded again"
|
print_text_in_color "$ICyan" "'sudo bash $SCRIPTS/nextcloud-startup-script.sh' and all the scripts will be downloaded again"
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -714,21 +725,21 @@ download_le_script() {
|
||||||
# call like: run_main_script name_of_script
|
# call like: run_main_script name_of_script
|
||||||
run_main_script() {
|
run_main_script() {
|
||||||
rm -f "${SCRIPTS}/${1}.sh" "${SCRIPTS}/${1}.php" "${SCRIPTS}/${1}.py"
|
rm -f "${SCRIPTS}/${1}.sh" "${SCRIPTS}/${1}.php" "${SCRIPTS}/${1}.py"
|
||||||
if wget -q "${GITHUB_REPO}/${1}.sh" -P "$SCRIPTS"
|
if curl_to_dir "${GITHUB_REPO}" "${1}.sh" "$SCRIPTS"
|
||||||
then
|
then
|
||||||
bash "${SCRIPTS}/${1}.sh"
|
bash "${SCRIPTS}/${1}.sh"
|
||||||
rm -f "${SCRIPTS}/${1}.sh"
|
rm -f "${SCRIPTS}/${1}.sh"
|
||||||
elif wget -q "${GITHUB_REPO}/${1}.php" -P "$SCRIPTS"
|
elif curl_to_dir "${GITHUB_REPO}" "${1}.php" "$SCRIPTS"
|
||||||
then
|
then
|
||||||
php "${SCRIPTS}/${1}.php"
|
php "${SCRIPTS}/${1}.php"
|
||||||
rm -f "${SCRIPTS}/${1}.php"
|
rm -f "${SCRIPTS}/${1}.php"
|
||||||
elif wget -q "${GITHUB_REPO}/${1}.py" -P "$SCRIPTS"
|
elif curl_to_dir "${GITHUB_REPO}" "${1}.py" "$SCRIPTS"
|
||||||
then
|
then
|
||||||
python "${SCRIPTS}/${1}.py"
|
python "${SCRIPTS}/${1}.py"
|
||||||
rm -f "${SCRIPTS}/${1}.py"
|
rm -f "${SCRIPTS}/${1}.py"
|
||||||
else
|
else
|
||||||
print_text_in_color "$Red" "Downloading ${1} failed"
|
print_text_in_color "$Red" "Downloading ${1} failed"
|
||||||
print_text_in_color "$ICyan" "Script failed to download. Please run: 'sudo wget ${GITHUB_REPO}/${1}.sh|php|py' again."
|
print_text_in_color "$ICyan" "Script failed to download. Please run: 'sudo curl -sLO ${GITHUB_REPO}/${1}.sh|php|py' again."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
@ -738,21 +749,21 @@ run_main_script() {
|
||||||
run_static_script() {
|
run_static_script() {
|
||||||
# Get ${1} script
|
# Get ${1} script
|
||||||
rm -f "${SCRIPTS}/${1}.sh" "${SCRIPTS}/${1}.php" "${SCRIPTS}/${1}.py"
|
rm -f "${SCRIPTS}/${1}.sh" "${SCRIPTS}/${1}.php" "${SCRIPTS}/${1}.py"
|
||||||
if wget -q "${STATIC}/${1}.sh" -P "$SCRIPTS"
|
if curl_to_dir "${STATIC}" "${1}.sh" "$SCRIPTS"
|
||||||
then
|
then
|
||||||
bash "${SCRIPTS}/${1}.sh"
|
bash "${SCRIPTS}/${1}.sh"
|
||||||
rm -f "${SCRIPTS}/${1}.sh"
|
rm -f "${SCRIPTS}/${1}.sh"
|
||||||
elif wget -q "${STATIC}/${1}.php" -P "$SCRIPTS"
|
elif curl_to_dir "${STATIC}" "${1}.php" "$SCRIPTS"
|
||||||
then
|
then
|
||||||
php "${SCRIPTS}/${1}.php"
|
php "${SCRIPTS}/${1}.php"
|
||||||
rm -f "${SCRIPTS}/${1}.php"
|
rm -f "${SCRIPTS}/${1}.php"
|
||||||
elif wget -q "${STATIC}/${1}.py" -P "$SCRIPTS"
|
elif curl_to_dir "${STATIC}" "${1}.py" "$SCRIPTS"
|
||||||
then
|
then
|
||||||
python "${SCRIPTS}/${1}.py"
|
python "${SCRIPTS}/${1}.py"
|
||||||
rm -f "${SCRIPTS}/${1}.py"
|
rm -f "${SCRIPTS}/${1}.py"
|
||||||
else
|
else
|
||||||
print_text_in_color "$Red" "Downloading ${1} failed"
|
print_text_in_color "$Red" "Downloading ${1} failed"
|
||||||
print_text_in_color "$ICyan" "Script failed to download. Please run: 'sudo wget ${STATIC}/${1}.sh|php|py' again."
|
print_text_in_color "$ICyan" "Script failed to download. Please run: 'sudo curl -sLO ${STATIC}/${1}.sh|php|py' again."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
@ -761,21 +772,21 @@ run_static_script() {
|
||||||
# call like: run_app_script collabora|nextant|passman|spreedme|contacts|calendar|webmin|previewgenerator
|
# call like: run_app_script collabora|nextant|passman|spreedme|contacts|calendar|webmin|previewgenerator
|
||||||
run_app_script() {
|
run_app_script() {
|
||||||
rm -f "${SCRIPTS}/${1}.sh" "${SCRIPTS}/${1}.php" "${SCRIPTS}/${1}.py"
|
rm -f "${SCRIPTS}/${1}.sh" "${SCRIPTS}/${1}.php" "${SCRIPTS}/${1}.py"
|
||||||
if wget -q "${APP}/${1}.sh" -P "$SCRIPTS"
|
if curl_to_dir "${APP}" "${1}.sh" "$SCRIPTS"
|
||||||
then
|
then
|
||||||
bash "${SCRIPTS}/${1}.sh"
|
bash "${SCRIPTS}/${1}.sh"
|
||||||
rm -f "${SCRIPTS}/${1}.sh"
|
rm -f "${SCRIPTS}/${1}.sh"
|
||||||
elif wget -q "${APP}/${1}.php" -P "$SCRIPTS"
|
elif curl_to_dir "${APP}" "${1}.php" "$SCRIPTS"
|
||||||
then
|
then
|
||||||
php "${SCRIPTS}/${1}.php"
|
php "${SCRIPTS}/${1}.php"
|
||||||
rm -f "${SCRIPTS}/${1}.php"
|
rm -f "${SCRIPTS}/${1}.php"
|
||||||
elif wget -q "${APP}/${1}.py" -P "$SCRIPTS"
|
elif curl_to_dir "${APP}" "${1}.py" "$SCRIPTS"
|
||||||
then
|
then
|
||||||
python "${SCRIPTS}/${1}.py"
|
python "${SCRIPTS}/${1}.py"
|
||||||
rm -f "${SCRIPTS}/${1}.py"
|
rm -f "${SCRIPTS}/${1}.py"
|
||||||
else
|
else
|
||||||
print_text_in_color "$Red" "Downloading ${1} failed"
|
print_text_in_color "$Red" "Downloading ${1} failed"
|
||||||
print_text_in_color "$ICyan" "Script failed to download. Please run: 'sudo wget ${APP}/${1}.sh|php|py' again."
|
print_text_in_color "$ICyan" "Script failed to download. Please run: 'sudo curl -sLO ${APP}/${1}.sh|php|py' again."
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
@ -832,7 +843,7 @@ or experience other issues then please report this to $ISSUES"
|
||||||
|
|
||||||
# Download the latest updater
|
# Download the latest updater
|
||||||
# cd $NCPATH
|
# cd $NCPATH
|
||||||
# wget -q https://github.com/nextcloud/updater/archive/master.zip
|
# curl sLO https://github.com/nextcloud/updater/archive/master.zip
|
||||||
# install_if_not unzip
|
# install_if_not unzip
|
||||||
# unzip -q master.zip
|
# unzip -q master.zip
|
||||||
# rm master.zip*
|
# rm master.zip*
|
||||||
|
|
|
@ -45,10 +45,9 @@ More information can be found here: https://unix.stackexchange.com/a/3064"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
network_ok() {
|
# Checks if site is reachable with a HTTP 200 status
|
||||||
print_text_in_color "$ICyan" "Testing if network is OK..."
|
site_200() {
|
||||||
service network-manager restart
|
if [[ "$(curl -sfIL --retry 3 "$1" | grep Status: | awk '{print$2}')" -eq 200 ]]
|
||||||
if wget -q -T 20 -t 2 http://github.com -O /dev/null
|
|
||||||
then
|
then
|
||||||
return 0
|
return 0
|
||||||
else
|
else
|
||||||
|
@ -56,6 +55,16 @@ network_ok() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
network_ok() {
|
||||||
|
print_text_in_color "$ICyan" "Testing if network is OK..."
|
||||||
|
install_if_not network-manager
|
||||||
|
if ! service network-manager restart > /dev/null
|
||||||
|
then
|
||||||
|
service networking restart > /dev/null
|
||||||
|
fi
|
||||||
|
sleep 5 && site_200 github.com
|
||||||
|
}
|
||||||
|
|
||||||
check_command() {
|
check_command() {
|
||||||
if ! "$@";
|
if ! "$@";
|
||||||
then
|
then
|
||||||
|
@ -116,7 +125,7 @@ You will now be provided with the option to set a static IP manually instead."
|
||||||
# Copy old interfaces files
|
# Copy old interfaces files
|
||||||
msg_box "Copying old netplan.io config files file to:
|
msg_box "Copying old netplan.io config files file to:
|
||||||
/tmp/netplan_io_backup/"
|
/tmp/netplan_io_backup/"
|
||||||
if [ -d /etc/netplan/ ]
|
if [ -d /etc/netplan/ ]
|
||||||
then
|
then
|
||||||
mkdir -p /tmp/netplan_io_backup
|
mkdir -p /tmp/netplan_io_backup
|
||||||
check_command cp -vR /etc/netplan/* /tmp/netplan_io_backup/
|
check_command cp -vR /etc/netplan/* /tmp/netplan_io_backup/
|
||||||
|
|
|
@ -76,7 +76,7 @@ check_universe
|
||||||
check_multiverse
|
check_multiverse
|
||||||
|
|
||||||
# Check if key is available
|
# Check if key is available
|
||||||
if ! wget -q -T 10 -t 2 "$NCREPO" > /dev/null
|
if ! site_200 "$NCREPO"
|
||||||
then
|
then
|
||||||
msg_box "Nextcloud repo is not available, exiting..."
|
msg_box "Nextcloud repo is not available, exiting..."
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -157,7 +157,7 @@ fi
|
||||||
|
|
||||||
# Install PostgreSQL
|
# Install PostgreSQL
|
||||||
# sudo add-apt-repository "deb http://apt.postgresql.org/pub/repos/apt/ bionic-pgdg main"
|
# sudo add-apt-repository "deb http://apt.postgresql.org/pub/repos/apt/ bionic-pgdg main"
|
||||||
# wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
|
# curl -fsSL https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
|
||||||
apt update -q4 & spinner_loading
|
apt update -q4 & spinner_loading
|
||||||
apt install postgresql-10 -y
|
apt install postgresql-10 -y
|
||||||
|
|
||||||
|
@ -521,7 +521,7 @@ rm -f results
|
||||||
# Get needed scripts for first bootup
|
# Get needed scripts for first bootup
|
||||||
if [ ! -f "$SCRIPTS"/nextcloud-startup-script.sh ]
|
if [ ! -f "$SCRIPTS"/nextcloud-startup-script.sh ]
|
||||||
then
|
then
|
||||||
check_command wget -q "$GITHUB_REPO"/nextcloud-startup-script.sh -P "$SCRIPTS"
|
curl_to_dir "$GITHUB_REPO" nextcloud-startup-script.sh "$SCRIPTS"
|
||||||
fi
|
fi
|
||||||
download_static_script instruction
|
download_static_script instruction
|
||||||
download_static_script history
|
download_static_script history
|
||||||
|
|
|
@ -126,7 +126,7 @@ if [ -d $ADMINERDIR ]
|
||||||
then
|
then
|
||||||
print_text_in_color "$ICyan" "Updating Adminer..."
|
print_text_in_color "$ICyan" "Updating Adminer..."
|
||||||
rm -f "$ADMINERDIR"/latest.php "$ADMINERDIR"/adminer.php
|
rm -f "$ADMINERDIR"/latest.php "$ADMINERDIR"/adminer.php
|
||||||
wget -q "http://www.adminer.org/latest.php" -O "$ADMINERDIR"/latest.php
|
curl_to_dir "http://www.adminer.org" "latest.php" "$ADMINERDIR"
|
||||||
ln -s "$ADMINERDIR"/latest.php "$ADMINERDIR"/adminer.php
|
ln -s "$ADMINERDIR"/latest.php "$ADMINERDIR"/adminer.php
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -227,7 +227,7 @@ fi
|
||||||
|
|
||||||
# Upgrade Nextcloud
|
# Upgrade Nextcloud
|
||||||
print_text_in_color "$ICyan" "Checking latest released version on the Nextcloud download server and if it's possible to download..."
|
print_text_in_color "$ICyan" "Checking latest released version on the Nextcloud download server and if it's possible to download..."
|
||||||
if ! wget -q --show-progress -T 10 -t 2 "$NCREPO/$STABLEVERSION.tar.bz2"
|
if ! curl -fSLO --retry 3 "$NCREPO/$STABLEVERSION.tar.bz2"
|
||||||
then
|
then
|
||||||
msg_box "Nextcloud does not exist. You were looking for: $NCVERSION
|
msg_box "Nextcloud does not exist. You were looking for: $NCVERSION
|
||||||
Please check available versions here: $NCREPO"
|
Please check available versions here: $NCREPO"
|
||||||
|
|
|
@ -13,7 +13,7 @@ true
|
||||||
DEBUG=0
|
DEBUG=0
|
||||||
debug_mode
|
debug_mode
|
||||||
|
|
||||||
if wget -q -T 10 -t 2 http://google.com > /dev/null
|
if site_200 google.com
|
||||||
then
|
then
|
||||||
ntpdate -s 1.se.pool.ntp.org
|
ntpdate -s 1.se.pool.ntp.org
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -69,7 +69,7 @@ eDROP_ARCHIVE_FILE="/usr/local/src/eDROP_{$EXEC_DATE}"
|
||||||
echo "Start time: $(date)"
|
echo "Start time: $(date)"
|
||||||
echo " "
|
echo " "
|
||||||
echo "Download daily DROP file:"
|
echo "Download daily DROP file:"
|
||||||
wget -q -O - "$URL" > $SPAMHAUS_DROP
|
curl -fsSL "$URL" > $SPAMHAUS_DROP
|
||||||
grep -v '^;' $SPAMHAUS_DROP | cut -d ' ' -f 1 > $DROP_ADD_TO_UFW
|
grep -v '^;' $SPAMHAUS_DROP | cut -d ' ' -f 1 > $DROP_ADD_TO_UFW
|
||||||
echo " "
|
echo " "
|
||||||
echo "Extract DROP IP addresses and add to UFW:"
|
echo "Extract DROP IP addresses and add to UFW:"
|
||||||
|
@ -81,7 +81,7 @@ echo " "
|
||||||
echo "Downloading eDROP list and import to UFW"
|
echo "Downloading eDROP list and import to UFW"
|
||||||
echo " "
|
echo " "
|
||||||
echo "Download daily eDROP file:"
|
echo "Download daily eDROP file:"
|
||||||
wget -q -O - "$eURL" > $SPAMHAUS_eDROP
|
curl -fsSL "$eURL" > $SPAMHAUS_eDROP
|
||||||
grep -v '^;' $SPAMHAUS_eDROP | cut -d ' ' -f 1 > $eDROP_ADD_TO_UFW
|
grep -v '^;' $SPAMHAUS_eDROP | cut -d ' ' -f 1 > $eDROP_ADD_TO_UFW
|
||||||
echo " "
|
echo " "
|
||||||
echo "Extract eDROP IP addresses and add to UFW:"
|
echo "Extract eDROP IP addresses and add to UFW:"
|
||||||
|
|
|
@ -12,10 +12,24 @@ true
|
||||||
DEBUG=0
|
DEBUG=0
|
||||||
debug_mode
|
debug_mode
|
||||||
|
|
||||||
$WGET -q --tries=20 --timeout=10 http://www.github.com -O /tmp/github.idx &> /dev/null
|
curl_to_dir() {
|
||||||
if [ ! -s /tmp/github.idx ]
|
check_command curl -sSL "$1"/"$2" -o "$3"/"$2"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Colors
|
||||||
|
Color_Off='\e[0m'
|
||||||
|
IRed='\e[0;91m'
|
||||||
|
IGreen='\e[0;92m'
|
||||||
|
ICyan='\e[0;96m'
|
||||||
|
|
||||||
|
print_text_in_color() {
|
||||||
|
printf "%b%s%b\n" "$1" "$2" "$Color_Off"
|
||||||
|
}
|
||||||
|
|
||||||
|
curl_to_dir google.com google.connectiontest /tmp
|
||||||
|
if [ ! -s /tmp/google.connectiontest ]
|
||||||
then
|
then
|
||||||
printf "${Red}Not Connected!${Color_Off}\n"
|
print_text_in_color "$IRed" "Not connected!"
|
||||||
else
|
else
|
||||||
printf "Connected!\n"
|
print_text_in_color "$IGreen" "Connected!"
|
||||||
fi
|
fi
|
||||||
|
|
Загрузка…
Ссылка в новой задаче