Skip to content

Commit

Permalink
samba: fix permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
nacho committed Aug 29, 2017
1 parent 79fb746 commit d6af472
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions etc/nextcloudpi-config.d/samba.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ from 'nextcloudpi-config'" \

configure()
{
[[ $ACTIVE_ != "yes" ]] && { service smbd stop; update-rc.d smbd disable; return; }
[[ $ACTIVE_ != "yes" ]] && { service smbd stop; update-rc.d smbd disable; echo "SMB disabled"; return; }

# CHECKS
################################
Expand All @@ -53,13 +53,18 @@ configure()

# CONFIG
################################
sed -i '/\[NextCloudPi\]/,+5d' /etc/samba/smb.conf
sed -i '/\[NextCloudPi\]/,+10d' /etc/samba/smb.conf
cat >> /etc/samba/smb.conf <<EOF
[NextCloudPi]
path = $DIR_
writeable = yes
; browseable = yes
valid users = $USER_
force group = www-data
create mask = 0770
directory mask = 0771
force create mode = 0660
force directory mode = 0770
EOF

update-rc.d smbd defaults
Expand All @@ -69,6 +74,7 @@ EOF
usermod -aG www-data $USER_
echo -e "$PWD_\n$PWD_" | smbpasswd -s -a $USER_
sudo chmod g+w $DIR_
echo "SMB enabled"
}

cleanup()
Expand Down

0 comments on commit d6af472

Please sign in to comment.