[Devel] [ openser-Patches-1362813 ] sc script updated for lcr
commands
SourceForge.net
noreply at sourceforge.net
Tue Nov 22 11:23:10 CET 2005
Patches item #1362813, was opened at 2005-11-21 15:34
Message generated for change (Settings changed) made by klaus_darilion
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=743022&aid=1362813&group_id=139143
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: ver devel
>Status: Closed
>Resolution: Accepted
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
>Assigned to: Klaus Darilion (klaus_darilion)
Summary: sc script updated for lcr commands
Initial Comment:
Here's a patch for sc "lcr addgw" command.
The QUERY command syntax was fixed.
The 'prefix' field was added as an optional parameter.
----------------------------------------------------------------------
Comment By: Nobody/Anonymous (nobody)
Date: 2005-11-21 15:42
Message:
Logged In: NO
Ooops ...
forgot to check the field to really update the attachement
:( and now I can't upload a file ...
Here's the patch:
<patch>
Index: sc
===================================================================
RCS file: /cvsroot/openser/sip-server/scripts/sc,v
retrieving revision 1.6
diff -u -r1.6 sc
--- sc 11 Aug 2005 12:08:02 -0000 1.6
+++ sc 21 Nov 2005 14:27:55 -0000
@@ -372,8 +372,9 @@
lcr addgw_grp <grp_name> ...................... add
gateway group, autocreate grp_id
lcr addgw_grp <grp_name> <grp_id> ............. add
gateway group with grp_id
lcr rmgw_grp <grp_id> ........................ delete the
gw_grp
- lcr addgw <gw_name> <ip> <port> <scheme> <transport>
<grp_id> .. add a gateway
- lcr rmgw <gw_name>
............................................ delete a gateway
+ lcr addgw <gw_name> <ip> <port> <scheme> <transport>
<grp_id> ........... add a gateway
+ lcr addgw <gw_name> <ip> <port> <scheme> <transport>
<grp_id> <prefix> .. add a gateway with prefix
+ lcr rmgw <gw_name>
..................................................... delete
a gateway
lcr addroute <prefix> <from> <grp_id> <prio> .. add a route
lcr rmroute <prefix> <from> <grp_id> <prio> .. delete a route
@@ -901,7 +902,7 @@
floor((ip_addr - floor(ip_addr / 16777216) * 16777216 -
floor((ip_addr - floor(ip_addr / 16777216) * 16777216) /
65536) * 65536) / 256),
floor((ip_addr - floor(ip_addr / 16777216) * 16777216) / 65536),
floor(ip_addr / 16777216) ), ') ') as ip,
- port, uri_scheme, transport,
grp_id
+ port, uri_scheme, transport,
grp_id, prefix
FROM $GW_TABLE ORDER BY
grp_id; "
sql_ro_query "$QUERY"
;;
@@ -978,11 +979,16 @@
;;
addgw)
shift
- if [ $# -ne 6 ] ; then
+ if [ $# -lt 6 ] ; then
echo too few paramters
usage
exit 1
fi
+ if [ $# -gt 6 ] ; then
+ GW_PREFIX=$7
+ else
+ GW_PREFIX=""
+ fi
GW_NAME=$1
GW_PORT=$3
GW_URI_SCHEME=$4
@@ -1006,8 +1012,7 @@
GW_IP=$(($1+$2*256+$3*65536+$4*16777216))
IFS=$oldIFS
prompt_pw
- #QUERY="insert into $GW_TABLE VALUES
('$GW_NAME', $GW_IP, $GW_PORT, $GW_URI_SCHEME,
$GW_TRANSPORT, $GW_GRP_ID);"
- QUERY="insert into $GW_TABLE VALUES
('$GW_NAME', $GW_IP, $GW_PORT, $GW_GRP_ID);"
+ QUERY="insert into $GW_TABLE VALUES
('$GW_NAME', $GW_GRP_ID, $GW_IP, $GW_PORT, $GW_URI_SCHEME,
$GW_TRANSPORT, '$GW_PREFIX');"
sql_query "$QUERY"
if [ $? -ne 0 ] ; then
echo "SQL Error"
</patch>
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=743022&aid=1362813&group_id=139143
More information about the Devel
mailing list