Commit ff8b787683692987fc42e081b48097fd609f1189
1 parent
a9640746ff
Exists in
master
Update install
Showing 1 changed file with 9 additions and 3 deletions Side-by-side Diff
scripts/install
| ... | ... | @@ -4,6 +4,7 @@ |
| 4 | 4 | domain=$1 |
| 5 | 5 | path=$2 |
| 6 | 6 | user=$3 |
| 7 | +password=$4 | |
| 7 | 8 | |
| 8 | 9 | # Check user parameter |
| 9 | 10 | ls /home | grep $user |
| ... | ... | @@ -12,6 +13,11 @@ if [[ ! $? -eq 0 ]]; then |
| 12 | 13 | exit 1 |
| 13 | 14 | fi |
| 14 | 15 | |
| 16 | +if [[ $password == "" ]]; then | |
| 17 | + echo "Wrong password" | |
| 18 | + exit 1 | |
| 19 | +fi | |
| 20 | + | |
| 15 | 21 | # Check domain/path availability |
| 16 | 22 | sudo yunohost app checkurl $domain$path -a owncloud |
| 17 | 23 | if [[ ! $? -eq 0 ]]; then |
| ... | ... | @@ -72,12 +78,12 @@ sudo yunohost app ssowatconf |
| 72 | 78 | # Owncloud installation via curl |
| 73 | 79 | echo "127.0.0.1 $domain #yunoowncloud" | sudo tee -a /etc/hosts |
| 74 | 80 | sleep 1 |
| 75 | -curl -kL -X POST https://$domain$path/index.php --data "install=true&adminlogin=$user&adminpass=$db_pwd&directory=/home/yunohost.app/owncloud/data&dbtype=mysql&dbuser=$db_user&dbpass=$db_pwd&dbname=$db_user&dbhost=localhost" > /dev/null 2>&1 | |
| 81 | +curl -kL -X POST https://$domain$path/index.php --data "install=true&adminlogin=$user&adminpass=$password&directory=/home/yunohost.app/owncloud/data&dbtype=mysql&dbuser=$db_user&dbpass=$db_pwd&dbname=$db_user&dbhost=localhost" > /dev/null 2>&1 | |
| 76 | 82 | |
| 77 | 83 | # Enable plugins |
| 78 | 84 | sleep 5 |
| 79 | -curl -kL -X POST https://$domain$path/index.php/settings/ajax/enableapp.php --data "appid=files_external" -u "$user:$db_pwd" > /dev/null 2>&1 | |
| 80 | -curl -kL -X POST https://$domain$path/index.php/settings/ajax/enableapp.php --data "appid=user_ldap" -u "$user:$db_pwd" > /dev/null 2>&1 | |
| 85 | +curl -kL -X POST https://$domain$path/index.php/settings/ajax/enableapp.php --data "appid=files_external" -u "$user:$password" > /dev/null 2>&1 | |
| 86 | +curl -kL -X POST https://$domain$path/index.php/settings/ajax/enableapp.php --data "appid=user_ldap" -u "$user:$password" > /dev/null 2>&1 | |
| 81 | 87 | |
| 82 | 88 | # Check if the Mysql database is initialized & running |
| 83 | 89 | mysql -u $db_user -p$db_pwd $db_user -e "select * from oc_appconfig;" > /dev/null 2>&1 |