Skip to content

Commit

Permalink
Merge pull request #163 from dianlight/release/10.0.2.nas
Browse files Browse the repository at this point in the history
Releasing refs/heads/release/10.0.2.nas into master
  • Loading branch information
dianlight authored Jul 10, 2023
2 parents 0320c88 + af37f24 commit 2e90318
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
4 changes: 4 additions & 0 deletions sambanas/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 10.0.2-nas4
### 🩹 BugFix
- Fix mount bug for ha 2023.7.x without acl config.

## 10.0.2-nas3

### ✨ Features
Expand Down
4 changes: 2 additions & 2 deletions sambanas/config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: Samba NAS
version: 10.0.2-nas3
version: 10.0.2-nas4
slug: sambanas
description: Expose Home Assistant disc with SMB/CIFS
url: https://github.com/dianlight/hassio-addons/tree/master/sambanas
Expand Down Expand Up @@ -118,6 +118,6 @@ host_ipc: true
#advanced: true
homeassistant: 2023.06.0
backup: hot
# Gemt Points!!!
# Get Points!!!
auth_api: true

Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,13 @@ if [ -f /tmp/cifs_network ]; then
#bashio::log "Samba Ready: ${status}"
#bashio::log "Children: $(smbcontrol smbd num-children)"

bashio::log "Wait Samba Server to going up..(max 30s)"
timeout 30 bash -c 'until printf "" 2>>/dev/null >>/dev/tcp/$0/$1; do sleep 1; done' ${ipaddress/\/*/} 445

while read -r -a device; do
[[ "share config addons ssl backup media" =~ $device ]] && continue
usage=$(jq -r --arg xshare "$device" '.acl[] | select(.share==$xshare) | .usage // "media"' <<<"$(bashio::addon.config)")
cmdshare=$(jq -nrc --arg usage "$usage" --arg share "$device" --arg ip "${ipaddress/\/*/}" --arg user "$username" --arg pwd "$password" '.name=$share|.usage=$usage|.type="cifs"|.server=$ip|.share=$share|.username=$user|.password=$pwd')
cmdshare=$(jq -nrc --arg usage "${usage:-media}" --arg share "$device" --arg ip "${ipaddress/\/*/}" --arg user "$username" --arg pwd "$password" '.name=$share|.usage=$usage|.type="cifs"|.server=$ip|.share=$share|.username=$user|.password=$pwd')
#bashio::log.info "${cmdshare}"
status=$(bashio::api.supervisor POST /mounts "${cmdshare}")
#bashio::log.info "Return from Mount: ${status}"
Expand Down

0 comments on commit 2e90318

Please sign in to comment.