added samba setup and config

This commit is contained in:
Snogard 2023-07-23 17:15:41 +02:00
parent e03a15d752
commit 648fc6ebb6
2 changed files with 31 additions and 0 deletions

View File

@ -0,0 +1,19 @@
#!/bin/bash
srcCondigFile=/etc/kaido/system/samba/smb.conf
dstConfigFile=/etc/samba/smb.conf
sudo systemctl stop smbd
echo "Copy $srcCondigFile to $dstConfigFile"
sudo cp $srcCondigFile $dstConfigFile
echo "Creating share folders"
cat system/samba/smb.conf | grep -vi ";" | grep -vi "#" | grep -i "path =" > /tmp/smbpaths.txt
while read path; do
echo "Creating folder at ${path:7}"
mkdir -p "${path:7}"
done < /tmp/smbpaths.txt
sudo systemctl start smbd

View File

@ -0,0 +1,12 @@
#!/bin/bash
sudo apt install -y samba samba-vfs-modules
sudo systemctl enable --now smbd
echo "Allowing samba ports"
sudo ufw allow 445/tcp
echo "Allow netbios ports"
sudo ufw allow 137/udp
sudo ufw allow 138/udp
sudo ufw allow 139/tcp