You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
429 B
24 lines
429 B
#!/bin/bash
|
|
|
|
if [[ -z $1 ]]; then
|
|
echo "Usage: $0 user"
|
|
exit 2
|
|
fi
|
|
user=$1
|
|
|
|
intdir=/srv/nextcloud/data
|
|
extdir=/vol/files
|
|
|
|
set -e
|
|
|
|
nc-occ maintenance:mode --on
|
|
|
|
mkdir -p $intdir/$user/files
|
|
chown -R www-data:www-data $intdir/$user
|
|
line="$extdir/$user $intdir/$user/files none defaults,bind,nofail 0 0"
|
|
if ! grep -q "$line" /etc/fstab ; then
|
|
echo "$line" >> /etc/fstab
|
|
fi
|
|
mount -a
|
|
|
|
nc-occ maintenance:mode --off
|
|
|