Skip to content

Commit

Permalink
Fix reserved names
Browse files Browse the repository at this point in the history
  • Loading branch information
dianlight committed Nov 17, 2023
1 parent 48b7d01 commit 58f76e8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ if [ -f /tmp/cifs_network ]; then
available_shares=$(awk '/\[(.*)\]/{ DISK=substr($1,2,length($1)-2); next } /.*path =(.*)/{ printf "%s\n",DISK,$0 }' /etc/samba/smb.conf)

while read -r -a device; do
[[ "share config addons ssl backup media" =~ $device ]] && continue
[[ "share config addons ssl backup media all_addon_configs homeassistant" =~ $device ]] && continue
status=$(bashio::api.supervisor DELETE /mounts/${device})
bashio::log.info "Return from Umount ${status}"
done <<<"${available_shares}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ if [ -f /tmp/cifs_network ]; then
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
[[ "share config addons ssl backup media all_addon_configs homeassistant" =~ $device ]] && continue
usage=$(jq -r --arg xshare "$device" '.acl[] | select(.share==$xshare) | .usage // "media"' <<<"$(bashio::addon.config)")
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}"
Expand Down
2 changes: 1 addition & 1 deletion sambanas/rootfs/etc/s6-overlay/s6-rc.d/init-automount/run
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function disk2label() { # $1 disk return (label disk or id)
function reserved_mount_name() { # $1 disk $2 cleanmountdisks
disk=$1
cleanmountdisks=$2
reserved_names=(config addons ssl share backup media)
reserved_names=(config addons ssl share backup media all_addon_configs homeassistant)
for disk in "${reserved_names[@]}"; do
if [[ ${cleanmountdisks[@]} =~ $disk ]]; then
tomountdisks=("${cleanmountdisks[@]/$disk/}")
Expand Down

0 comments on commit 58f76e8

Please sign in to comment.