forked from ddominet/UDMPRO-samba
-
Notifications
You must be signed in to change notification settings - Fork 1
/
20-samba.sh
32 lines (23 loc) · 833 Bytes
/
20-samba.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/sh
# variables
username="user"
password="password"
share_name="Shared"
DRIVE="sda1"
container_name="samba"
# mounting and creating shared file if it doesn't exit
if [ ! -d /mnt/drive ]; then
mkdir /mnt/drive
mount /dev/$DRIVE /mnt/drive
fi
FILE=/mnt/drive/share
if [ ! -d "$FILE" ]; then
mkdir $FILE
chmod 7777 $FILE
fi
# starting the container
if [ "$(podman ps -a -q -f name=${container_name})" ]; then
podman kill ${container_name}
podman rm ${container_name}
fi
podman run --name ${container_name} -p 139:139 -p 445:445 -p 137:137/udp -p 138:138/udp -v "$FILE:/share:Z" -d dperson/samba -n -u "${username};${password}" -s "${share_name};/share;yes;no;no;all;none;none;Shared files" -p -r -g "fruit:model = MacPro7,1@ECOLOR=226,226,224" -g "fruit:resource = xattr" -g "fruit:metadata = stream"