소스 검색

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
Victor Seva 10 년 전
부모
커밋
83d39ae5b8
1개의 변경된 파일7개의 추가작업 그리고 7개의 파일을 삭제
  1. 7 7
      examples/sr

+ 7 - 7
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