Ajouter 'setup.sh'

This commit is contained in:
adminbruno committed 2024-02-08 13:59:58 -05:00
1 parent 5963422a5e
commit edd3888ef7
1 file changed
+17
+17
View File
@@ -0,0 +1,17 @@
#!/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"