[sr-dev] git:master:83d39ae5: examples: fix bashism in /bin/sh script
Victor Seva
linuxmaniac at torreviejawireless.org
Mon Feb 16 16:16:17 CET 2015
Module: kamailio
Branch: master
Commit: 83d39ae5b8b523c70b6fba9699efc681595430f8
URL: https://github.com/kamailio/kamailio/commit/83d39ae5b8b523c70b6fba9699efc681595430f8
Author: Victor Seva <linuxmaniac at torreviejawireless.org>
Committer: Victor Seva <linuxmaniac at torreviejawireless.org>
Date: 2015-02-16T16:14:32+01:00
examples: fix bashism in /bin/sh script
$/usr/bin/checkbashisms examples/sr
possible bashism in examples/sr line 41 (function names should only contain [a-z0-9_]):
sip-router_start() {
possible bashism in examples/sr line 43 ($HOST(TYPE|NAME)):
echo "before startup sip-router core found on `date` at $HOSTNAME" > $TMP
possible bashism in examples/sr line 63 (function names should only contain [a-z0-9_]):
sip-router_stop() {
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=772314
---
Modified: examples/sr
---
Diff: https://github.com/kamailio/kamailio/commit/83d39ae5b8b523c70b6fba9699efc681595430f8.diff
Patch: https://github.com/kamailio/kamailio/commit/83d39ae5b8b523c70b6fba9699efc681595430f8.patch
---
diff --git a/examples/sr b/examples/sr
index 99cd0f0..c950a80 100755
--- a/examples/sr
+++ b/examples/sr
@@ -38,9 +38,9 @@ MYDIR=$HM/core
CORE=$MYDIR/core
TMP=/tmp/srcore.$$
-sip-router_start() {
+sip_router_start() {
if [ -r $BIN -a -r $CORE ] ; then
- echo "before startup sip-router core found on `date` at $HOSTNAME" > $TMP
+ echo "before startup sip-router core found on `date` at `hostname`" > $TMP
echo "----------------------------------" >> $TMP
DATE=`date "+%Y-%m-%d--%H-%M"`
NEWCORE=$MYDIR/core.$DATE
@@ -60,7 +60,7 @@ sip-router_start() {
echo
}
-sip-router_stop() {
+sip_router_stop() {
echo "Stopping SIP router: "
killproc $BINNAME
RETVAL=$?
@@ -84,15 +84,15 @@ monit_stop() {
# See how we were called.
case "$1" in
serstart)
- sip-router_start
+ sip_router_start
;;
sip-routerstop)
- sip-router_stop
+ sip_router_stop
;;
sip-routerrestart)
- sip-router_stop
+ sip_router_stop
echo
- sip-router_start
+ sip_router_start
;;
start)
monit_start
More information about the sr-dev
mailing list