Skip to content

Commit

Permalink
Merge pull request #271 from TECH7Fox/fix-sounds-permissions
Browse files Browse the repository at this point in the history
Fix downloaded sounds permissions
  • Loading branch information
felipecrs committed Jul 28, 2023
2 parents cc83e6e + 3da09ec commit 975110b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
3 changes: 2 additions & 1 deletion asterisk/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
- Ensure Asterisk Mailbox Server is started with `--verbose` if log level is debug or higher
- Fix Asterisk Mailbox Server media directory to `/media/asterisk/voicemail/default/<mailbox-extension>/` for persistency
- Fix Asterisk Mailbox Server cache file to `/data/tmp` for persistency
- Fix to the `/data` directory (and also `/media` when needed) are created on startup, useful when running the add-on as a standalone docker container.
- Fix to the `/data` directory (and also `/media` when needed) are created on startup, useful when running the add-on as a standalone docker container
- Fix the permissions of downloaded sounds to be `0755` to be as indicated by <https://asterisksounds.org>, although on my tests it was working before as well.

### Upgrades

Expand Down
8 changes: 3 additions & 5 deletions asterisk/rootfs/etc/cont-init.d/asterisk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,6 @@ for sound in "${additional_sounds[@]}"; do

if [[ -f "${lang_file}" && "$(cat "${lang_file}")" == "${sound}" ]]; then
bashio::log.info "Skipping sounds download for '${sound}'..."
rm -rf "${asterisk_sound_dir}"
ln -svf "${sound_dir}" "${asterisk_sound_dir}"
else
bashio::log.info "Downloading '${sound}' sounds to '${sound_dir}'..."

Expand Down Expand Up @@ -244,10 +242,10 @@ for sound in "${additional_sounds[@]}"; do

cd - >/dev/null || exit 1

chmod 0755 -R "${temp_dir}"
rsync -a "${temp_dir}/" "${sound_dir}/"
rm -rf "${asterisk_sound_dir}"
ln -svf "${sound_dir}" "${asterisk_sound_dir}"

rm -rf "${temp_dir}"
fi
rm -rf "${asterisk_sound_dir}"
ln -svf "${sound_dir}" "${asterisk_sound_dir}"
done

0 comments on commit 975110b

Please sign in to comment.