|
From: <abe...@us...> - 2014-03-12 00:29:53
|
Revision: 6454
http://sourceforge.net/p/astlinux/code/6454
Author: abelbeck
Date: 2014-03-12 00:29:48 +0000 (Wed, 12 Mar 2014)
Log Message:
-----------
phoneprov-tools, add PHONEPROV_GW_IF rc.conf variable and auto-reload Asterisk option
Modified Paths:
--------------
branches/1.0/package/phoneprov-tools/phoneprov-build
branches/1.0/package/phoneprov-tools/phoneprov-massdeployment
branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf
Modified: branches/1.0/package/phoneprov-tools/phoneprov-build
===================================================================
--- branches/1.0/package/phoneprov-tools/phoneprov-build 2014-03-11 17:27:16 UTC (rev 6453)
+++ branches/1.0/package/phoneprov-tools/phoneprov-build 2014-03-12 00:29:48 UTC (rev 6454)
@@ -10,7 +10,8 @@
Options:
-f, --force-overwrite Overwrite existing files
-h, --help Show this help text
- -i, --if-name Interface Name: INTIF, INT2IF, INT3IF, EXTIF, ethN, brN, defaults to INTIF
+ -i, --if-name Interface Name: INTIF, INT2IF, INT3IF, EXTIF, ethN, brN
+ Defaults to config variable PHONEPROV_GW_IF
'
exit 1
}
@@ -146,7 +147,7 @@
eval set -- $ARGS
force_overwrite=0
-if_name="INTIF"
+if_name="${PHONEPROV_GW_IF:-INTIF}"
while [ $# -gt 0 ]; do
case "$1" in
-f|--force-overwrite) force_overwrite=1 ;;
Modified: branches/1.0/package/phoneprov-tools/phoneprov-massdeployment
===================================================================
--- branches/1.0/package/phoneprov-tools/phoneprov-massdeployment 2014-03-11 17:27:16 UTC (rev 6453)
+++ branches/1.0/package/phoneprov-tools/phoneprov-massdeployment 2014-03-12 00:29:48 UTC (rev 6454)
@@ -13,12 +13,23 @@
-A, --only-pass Same as "-a, --auto-pass" without further processing
-f, --force-overwrite Overwrite existing files
-h, --help Show this help text
- -i, --if-name Interface Name: INTIF, INT2IF, INT3IF, EXTIF, ethN, brN, defaults to INTIF
+ -i, --if-name Interface Name: INTIF, INT2IF, INT3IF, EXTIF, ethN, brN
+ Defaults to config variable PHONEPROV_GW_IF
-p, --partial Partial input, append "dialplan" and "sip" entries to existing
+ -r, --auto-reload Automatically reload Asterisk "dialplan" and "sip" on success
+ -R, --only-reload Same as "-r, --auto-reload" without further processing
'
exit 1
}
+reload_asterisk()
+{
+ echo "Auto-reloading Asterisk 'dialplan' and 'sip'."
+
+ asterisk -rx "dialplan reload" >/dev/null
+ asterisk -rx "sip reload" >/dev/null
+}
+
error_info() {
local result="$1"
@@ -70,8 +81,8 @@
}
ARGS="$(getopt --name phoneprov-massdeployment \
- --long auto-pass,only-pass,force-overwrite,help,if-name:,partial \
- --options aAfhi:p \
+ --long auto-pass,only-pass,force-overwrite,help,if-name:,partial,auto-reload,only-reload \
+ --options aAfhi:prR \
-- "$@")"
if [ $? -ne 0 ]; then
usage
@@ -82,21 +93,30 @@
only_pass=0
force_overwrite=0
partial=0
-if_name="INTIF"
+auto_reload=0
+only_reload=0
+if_name=""
while [ $# -gt 0 ]; do
case "$1" in
- -a|--auto-pass) auto_pass=1 ;;
- -A|--only-pass) auto_pass=1 ; only_pass=1 ;;
+ -a|--auto-pass) auto_pass=1 ;;
+ -A|--only-pass) auto_pass=1 ; only_pass=1 ;;
-f|--force-overwrite) force_overwrite=1 ;;
-h|--help) usage ;;
-i|--if-name) if_name="$2"; shift ;;
-p|--partial) partial=1 ;;
+ -r|--auto-reload) auto_reload=1 ;;
+ -R|--only-reload) auto_reload=1 ; only_reload=1 ;;
--) shift; break ;;
esac
shift
done
in_file="$1"
+if [ $auto_reload -eq 1 -a $only_reload -eq 1 ]; then
+ reload_asterisk
+ exit 0
+fi
+
if [ -z "$in_file" -o "$in_file" = "--" ]; then
usage
fi
@@ -173,5 +193,10 @@
fi
echo "Done"
+
+if [ $auto_reload -eq 1 ]; then
+ reload_asterisk
+fi
+
exit 0
Modified: branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf
===================================================================
--- branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf 2014-03-11 17:27:16 UTC (rev 6453)
+++ branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf 2014-03-12 00:29:48 UTC (rev 6454)
@@ -340,6 +340,9 @@
##
## Default base directory for phoneprov-tools scripts, default is "/mnt/kd/phoneprov"
#PHONEPROV_BASE_DIR="/mnt/kd/phoneprov"
+## Default gateway interface for phoneprov-tools scripts.
+## Interface Name: "INTIF", "INT2IF", "INT3IF", "EXTIF", ethN, brN, defaults to "INTIF"
+#PHONEPROV_GW_IF="INTIF"
## NTPd Server
## Note: also see NTPSERVS in the "General Configuration" section.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|