Skip to content

Commit

Permalink
fix: Shared folder mount (#202)
Browse files Browse the repository at this point in the history
  • Loading branch information
kroese authored Oct 13, 2024
1 parent 2397a3e commit 7016a9c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ kubectl apply -f kubernetes.yml

```yaml
volumes:
- /home/user/example:/shared
- /home/user/example:/data
```

The example folder `/home/user/example` will be available as ` \\host.lan\Data`.
Expand Down
14 changes: 11 additions & 3 deletions src/samba.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,15 @@ if [[ "$DHCP" == [Yy1]* ]]; then
interface="$VM_NET_DEV"
fi

share="/shared"
share="/data"

if [ ! -d "$share" ] && [ -d "$STORAGE/data" ]; then
share="$STORAGE/data"
fi

if [ ! -d "$share" ] && [ -d "/shared" ]; then
share="/shared"
fi

if [ ! -d "$share" ] && [ -d "$STORAGE/shared" ]; then
share="$STORAGE/shared"
Expand All @@ -36,11 +44,11 @@ if [ -z "$(ls -A "$share")" ]; then
echo "To change its location, include the following bind mount in your compose file:"
echo ""
echo " volumes:"
echo " - \"/home/user/example:/shared\""
echo " - \"/home/user/example:/data\""
echo ""
echo "Or in your run command:"
echo ""
echo " -v \"/home/user/example:/shared\""
echo " -v \"/home/user/example:/data\""
echo ""
echo "Replace the example path /home/user/example with the desired shared folder."
echo ""
Expand Down

0 comments on commit 7016a9c

Please sign in to comment.