update script

This commit is contained in:
root 2012-07-26 20:37:53 +02:00
parent b17b9eb435
commit 5bfe82c52f

View file

@ -1,27 +1,41 @@
#!/bin/bash
echo "YunoHost Installation"
echo "Do you want install Yunhost? (Y/n)"
echo "======== YunoHost Installation ========"
echo "======== Check dependences ========"
DOMAIN=$(hostname -d)
dpkg -l | grep -q lsb-release
if [ $? = 1 ];
then
apt-get update -qq
apt-get install lsb-release -y
fi
read rep
echo "======== Check domain ========"
whiptail --title "Yunohost Domain" --yesno "Your domain is $DOMAIN\nDo you want to change this?" 8 78
if [ $? = 0 ];
then
DOMAIN=$(whiptail --inputbox "Enter your new domain please" 8 78 --title "Yunohost Domain" 3>&1 1>&2 2>&3)
fi
if [ $rep = "Y" ] || [ $rep = "y" ];
whiptail --title "Yunohost Installation" --yesno "Do you want install Yunhost?" 8 78
if [ $? = 0 ];
then
echo "======== Update hostname ========"
# Update hostname
echo "yunohost" > /etc/hostname
grep "yunohost.$(hostname -d)" /etc/hosts
grep -q "yunohost.$DOMAIN" /etc/hosts
if [ $? = 1 ];
then
echo -e "127.0.0.1\tyunohost.$(hostname -d)\tyunohost" > /etc/hosts
echo -e "127.0.0.1\tyunohost.$DOMAIN\tyunohost" > /etc/hosts
/etc/init.d/hostname.sh start
fi
echo "======== Add repository ========"
#Get gpg key
wget -O- http://lemonldap-ng.org/_media/rpm-gpg-key-ow2 | apt-key add -
wget -O- http://repo.yunohost.org/yunohost.asc | apt-key add -
grep "lemonldap-ng.org" /etc/apt/sources.list
wget -O- http://lemonldap-ng.org/_media/rpm-gpg-key-ow2 -q | apt-key add - -qq
wget -O- http://repo.yunohost.org/yunohost.asc -q | apt-key add - -qq
grep -q "lemonldap-ng.org" /etc/apt/sources.list
exit 0
if [ $? = 1 ];
then
echo "deb http://lemonldap-ng.org/deb squeeze main" >> /etc/apt/sources.list
@ -39,7 +53,7 @@ then
fi
#Update repo
apt-get update
apt-get update -qq
if [ $? != 0 ] ;
then
echo "Update Repo Failure"
@ -51,14 +65,14 @@ then
debconf-set-selections debconf
#Install yunohost packages
apt-get install yunohost yunohost-config yunohost-config-postfix postfix postfix-ldap postfix-policyd-spf-perl -y
debconf-apt-progress -- apt-get -y install yunohost yunohost-config yunohost-config-postfix postfix postfix-ldap postfix-policyd-spf-perl -y
if [ $? != 0 ] ;
then
echo "Install yunohost Failure"
exit 1
else
mysqladmin -u root -pyunohost password ''
service slapd restart
service slapd restart
service apache2 restart
service dovecot restart
service postfix restart