Last active
March 27, 2019 01:39
-
-
Save peacefixation/646a00c7b7cb2ec40f6e109ed10a7ae5 to your computer and use it in GitHub Desktop.
Remove keys from Asterisk database
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# remove each family of keys that match the specified pattern from the Asterisk database | |
# 4 digits | |
FAMILY_PATTERN="[0-9][0-9][0-9][0-9]" | |
for FAMILY in `asterisk -rx "database show" | cut -d' ' -f1 | egrep -a "/${FAMILY_PATTERN}/" | cut -d'/' -f2 | uniq`; do | |
asterisk -rx "database deltree ${FAMILY}"; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment