You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
356 B
17 lines
356 B
#!/bin/bash
|
|
|
|
#VARS
|
|
CONFIGFILE="/etc/asterisk/extensions_custom.conf"
|
|
DIRECTORY="/etc/asterisk/extensions.d"
|
|
NEWCONF=$(cat <<EOF
|
|
[globals]
|
|
#tryinclude extensions.d/*.conf
|
|
EOF
|
|
)
|
|
|
|
#Test and Create sub config dir
|
|
[ -d $DIRECTORY ] || mkdir $DIRECTORY
|
|
|
|
|
|
#Test for and add config accordingly
|
|
grep -Fxq "$NEWCONF" "$CONFIGFILE" || echo "$NEWCONF" >> "$CONFIGFILE" |