Commit 538aac04e752e779277ce90e9b473c08ab767963
1 parent
a293d369cc
Exists in
master
[fix] Properly check YunoHost users
Showing 1 changed file with 3 additions and 2 deletions Side-by-side Diff
scripts/install
... | ... | @@ -6,7 +6,7 @@ path=$2 |
6 | 6 | user=$3 |
7 | 7 | |
8 | 8 | # Check user parameter |
9 | -ls /home | grep $user | |
9 | +sudo yunohost user list --json | grep -q '"id": "$user"' | |
10 | 10 | if [[ ! $? -eq 0 ]]; then |
11 | 11 | echo "Wrong user" |
12 | 12 | exit 1 |
... | ... | @@ -61,7 +61,8 @@ sudo sed -i "s@NAMETOCHANGE@owncloud@g" /etc/php5/fpm/pool.d/owncloud.conf |
61 | 61 | # Set permissions to owncloud directories and /home directories + add Home external storage |
62 | 62 | for i in $(ls /home) |
63 | 63 | do |
64 | - if [[ ! $i == yunohost.* ]]; | |
64 | + sudo yunohost user list --json | grep -q '"id": "$i"' | |
65 | + if [[ $? -eq 0 ]]; | |
65 | 66 | then |
66 | 67 | sudo setfacl -m g:owncloud:rwx /home/$i |
67 | 68 | sudo mkdir $data_path/$i |