mirror of
https://gitlab.com/Snogard/kaido.git
synced 2025-08-20 10:50:06 +02:00
added samba setup and config
This commit is contained in:
parent
e03a15d752
commit
648fc6ebb6
19
src/commands/config/config-samba.sh
Executable file
19
src/commands/config/config-samba.sh
Executable 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
|
12
src/commands/setup/setup-samba.sh
Executable file
12
src/commands/setup/setup-samba.sh
Executable 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
|
Loading…
x
Reference in New Issue
Block a user