mirror of
https://github.com/YunoHost/install_script.git
synced 2024-09-03 20:06:25 +02:00
update script
This commit is contained in:
parent
b17b9eb435
commit
5bfe82c52f
1 changed files with 26 additions and 12 deletions
|
@ -1,27 +1,41 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
echo "YunoHost Installation"
|
echo "======== YunoHost Installation ========"
|
||||||
echo "Do you want install Yunhost? (Y/n)"
|
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
|
then
|
||||||
echo "======== Update hostname ========"
|
echo "======== Update hostname ========"
|
||||||
# Update hostname
|
# Update hostname
|
||||||
echo "yunohost" > /etc/hostname
|
echo "yunohost" > /etc/hostname
|
||||||
grep "yunohost.$(hostname -d)" /etc/hosts
|
grep -q "yunohost.$DOMAIN" /etc/hosts
|
||||||
if [ $? = 1 ];
|
if [ $? = 1 ];
|
||||||
then
|
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
|
/etc/init.d/hostname.sh start
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "======== Add repository ========"
|
echo "======== Add repository ========"
|
||||||
#Get gpg key
|
#Get gpg key
|
||||||
wget -O- http://lemonldap-ng.org/_media/rpm-gpg-key-ow2 | apt-key add -
|
wget -O- http://lemonldap-ng.org/_media/rpm-gpg-key-ow2 -q | apt-key add - -qq
|
||||||
wget -O- http://repo.yunohost.org/yunohost.asc | apt-key add -
|
wget -O- http://repo.yunohost.org/yunohost.asc -q | apt-key add - -qq
|
||||||
grep "lemonldap-ng.org" /etc/apt/sources.list
|
grep -q "lemonldap-ng.org" /etc/apt/sources.list
|
||||||
|
exit 0
|
||||||
if [ $? = 1 ];
|
if [ $? = 1 ];
|
||||||
then
|
then
|
||||||
echo "deb http://lemonldap-ng.org/deb squeeze main" >> /etc/apt/sources.list
|
echo "deb http://lemonldap-ng.org/deb squeeze main" >> /etc/apt/sources.list
|
||||||
|
@ -39,7 +53,7 @@ then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#Update repo
|
#Update repo
|
||||||
apt-get update
|
apt-get update -qq
|
||||||
if [ $? != 0 ] ;
|
if [ $? != 0 ] ;
|
||||||
then
|
then
|
||||||
echo "Update Repo Failure"
|
echo "Update Repo Failure"
|
||||||
|
@ -51,7 +65,7 @@ then
|
||||||
debconf-set-selections debconf
|
debconf-set-selections debconf
|
||||||
|
|
||||||
#Install yunohost packages
|
#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 ] ;
|
if [ $? != 0 ] ;
|
||||||
then
|
then
|
||||||
echo "Install yunohost Failure"
|
echo "Install yunohost Failure"
|
||||||
|
|
Loading…
Add table
Reference in a new issue