From f7fa5b727e5fadfee2953e4d5f420a42b79dc2a8 Mon Sep 17 00:00:00 2001 From: Daniel Hansson Date: Sun, 5 Mar 2017 20:48:00 +0100 Subject: [PATCH] even better repo check (#156) --- nextcloud-startup-script.sh | 2 +- nextcloud_install_production.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/nextcloud-startup-script.sh b/nextcloud-startup-script.sh index acf170b1..fe27c9fd 100644 --- a/nextcloud-startup-script.sh +++ b/nextcloud-startup-script.sh @@ -71,7 +71,7 @@ fi # Check where the best mirrors are and update echo echo "Some VPS providers have local download mirrors preconfigured, some don't." -REPO=$(apt-cache policy | grep -m1 http| awk '{ print $2}') +REPO=$(apt-get update | grep -m 1 Hit | awk '{ print $2}') echo -e "Your current server repository is: \e[36m$REPO\e[0m" function ask_yes_or_no() { read -p "$1 ([y]es or [N]o): " diff --git a/nextcloud_install_production.sh b/nextcloud_install_production.sh index 814e40ee..e5eaaf6c 100644 --- a/nextcloud_install_production.sh +++ b/nextcloud_install_production.sh @@ -188,7 +188,7 @@ apt install language-pack-en-base -y sudo locale-gen "sv_SE.UTF-8" && sudo dpkg-reconfigure --frontend=noninteractive locales # Check where the best mirrors are and update -REPO=$(apt-cache policy | grep -m1 http| awk '{ print $2}') +REPO=$(apt-get update | grep -m 1 Hit | awk '{ print $2}') echo -e "Your server repository is:  \e[36m$REPO\e[0m" function ask_yes_or_no() { read -p "$1 ([y]es or [N]o): "