From 42aaf1de6d1f582c84c154d6b8874548eaa7dc6f Mon Sep 17 00:00:00 2001 From: adrien Date: Fri, 12 Oct 2012 18:55:31 +0200 Subject: [PATCH] add caution and depends loops --- install_yunohost | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/install_yunohost b/install_yunohost index 4d5f3d7..321e9d6 100755 --- a/install_yunohost +++ b/install_yunohost @@ -31,12 +31,15 @@ fi echo "======== YunoHost Installation ========" echo "======== Check dependences ========" -dpkg -l | grep -q lsb-release -if [[ $? -eq 1 ]] -then - apt-get update -qq - apt-get install lsb-release -y -fi +apt-get update -qq +for i in lsb-release wget whiptail +do + dpkg -l | grep -q $i + if [[ $? -eq 1 ]] + then + apt-get install $i -y + fi +done if [[ ! -f /etc/yunohost/yunohost.conf ]] then @@ -108,6 +111,17 @@ then CUSTOMAPT=/etc/apt/sources.list + if [[ "$(lsb_release -cs)" = "wheezy" ]] || [[ "$(lsb_release -cs)" = "n/a" ]] + then + whiptail --title "Yunohost Installation" --yesno "Caution : Yunohost v2 is in development.\nDo you want to proceed install of Yunohost?" 8 78 + YESNO=$? + if [[ $YESNO -eq 0 ]] + then + echo "======== Installation cancelled ========" + exit $ERR_CANCEL_INSTALL + fi + fi + grep -qri "yunohost" $CUSTOMAPT if [[ $? -eq 1 ]] then @@ -116,9 +130,9 @@ then echo "deb http://repo.yunohost.org/ squeeze main" >> $CUSTOMAPT echo "deb http://repo.yunohost.org/ apps main" >> $CUSTOMAPT ;; - "wheezy"|"n/a") - echo "deb http://repo.yunohost.org/ megusta main" >> $CUSTOMAPT - echo "deb http://repo.yunohost.org/ apps main" >> $CUSTOMAPT + "wheezy"|"n/a") + echo "deb http://repo.yunohost.org/ megusta main" >> $CUSTOMAPT + echo "deb http://repo.yunohost.org/ apps main" >> $CUSTOMAPT ;; esac fi