mirror of
https://github.com/asterisk/asterisk.git
synced 2025-08-16 11:14:52 +00:00
As described in the issue, /tmp is not a suitable location for a large amount of cached media files, since most distributions make /tmp a RAM-based tmpfs mount with limited capacity. I opted for a location that can be configured separately, as opposed to using a subdirectory of spooldir, given the different storage profile (transient files vs files that might stay there indefinitely). This commit just makes the cache directory configurable, and changes the default location from /tmp to /var/cache/asterisk. ASTERISK-29143 Change-Id: Ic54e95199405abacd9e509cef5f08fa14c510b5d
45 lines
1.0 KiB
Bash
Executable File
45 lines
1.0 KiB
Bash
Executable File
#!/bin/sh
|
|
|
|
# install_subst: install a script while doing path substitution
|
|
|
|
# install_subst [-d] source destination
|
|
#
|
|
# -d: file is data (rather than script)
|
|
|
|
install_args=
|
|
if [ "$1" = '-d' ]; then
|
|
install_args="-m 644"
|
|
shift
|
|
fi
|
|
|
|
set -e
|
|
|
|
tmp=`mktemp install_subst_XXXXXX`
|
|
|
|
cleanup_tmp() {
|
|
rm -f "$tmp"
|
|
}
|
|
|
|
# Delete it on exit
|
|
trap cleanup_tmp 0
|
|
|
|
src="$1"
|
|
dst="$2"
|
|
sed <"$src" \
|
|
-e "s|__ASTERISK_CACHE_DIR__|$ASTCACHEDIR|g" \
|
|
-e "s|__ASTERISK_DATA_DIR__|$ASTDATADIR|g" \
|
|
-e "s|__ASTERISK_DB_DIR__|$ASTDBDIR|g" \
|
|
-e "s|__ASTERISK_ETC_DIR__|$ASTETCDIR|g" \
|
|
-e "s|__ASTERISK_HEADER_DIR__|$ASTHEADERDIR|g" \
|
|
-e "s|__ASTERISK_LIB_DIR__|$ASTLIBDIR|g" \
|
|
-e "s|__ASTERISK_LOG_DIR__|$ASTLOGDIR|g" \
|
|
-e "s|__ASTERISK_MOD_DIR__|$ASTMODDIR|g" \
|
|
-e "s|__ASTERISK_MAN_DIR__|$ASTMANDIR|g" \
|
|
-e "s|__ASTERISK_SBIN_DIR__|$ASTSBINDIR|g" \
|
|
-e "s|__ASTERISK_SPOOL_DIR__|$ASTSPOOLDIR|g" \
|
|
-e "s|__ASTERISK_VARLIB_DIR__|$ASTVARLIBDIR|g" \
|
|
-e "s|__ASTERISK_VARRUN_DIR__|$ASTVARRUNDIR|g" \
|
|
> "$tmp"
|
|
|
|
install $install_args "$tmp" "$dst"
|