2024-05-24 18:01:58 +08:00
|
|
|
#!/usr/bin/env bash
|
2022-09-30 23:10:57 +08:00
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
NAME=smb
|
|
|
|
USER=rclone
|
|
|
|
PASS=GNF3Cqeu
|
|
|
|
WORKGROUP=thepub
|
2024-04-08 23:51:49 +08:00
|
|
|
PORT=28630
|
2022-09-30 23:10:57 +08:00
|
|
|
|
|
|
|
. $(dirname "$0")/docker.bash
|
|
|
|
|
|
|
|
start() {
|
2024-04-08 23:51:49 +08:00
|
|
|
docker run --rm -d --name $NAME \
|
|
|
|
-p 127.0.0.1:${PORT}:445 \
|
|
|
|
-p 127.0.0.1:${PORT}:445/udp \
|
|
|
|
dperson/samba \
|
2022-09-30 23:10:57 +08:00
|
|
|
-p \
|
|
|
|
-u "rclone;${PASS}" \
|
|
|
|
-w "${WORKGROUP}" \
|
|
|
|
-s "public;/share" \
|
|
|
|
-s "rclone;/rclone;yes;no;no;rclone"
|
|
|
|
|
|
|
|
echo type=smb
|
2024-04-08 23:51:49 +08:00
|
|
|
echo host=127.0.0.1
|
2022-09-30 23:10:57 +08:00
|
|
|
echo user=$USER
|
2024-04-08 23:51:49 +08:00
|
|
|
echo port=$PORT
|
2022-09-30 23:10:57 +08:00
|
|
|
echo pass=$(rclone obscure $PASS)
|
|
|
|
echo domain=$WORKGROUP
|
2024-04-08 23:51:49 +08:00
|
|
|
echo _connect=127.0.0.1:${PORT}
|
2022-09-30 23:10:57 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
. $(dirname "$0")/run.bash
|