Module: kamailio Branch: master Commit: 30857dfe5d0e0e99050fec6437c77f6baafae399 URL: https://github.com/kamailio/kamailio/commit/30857dfe5d0e0e99050fec6437c77f6b...
Author: micmac1 sebastian_ml@gmx.net Committer: Henning Westerholt henningw@users.noreply.github.com Date: 2019-01-20T20:58:11+01:00
utils: kamctl, kamdbctl improve POSIX compatibility for embedded systems (#1815)
- Use portable "#!/bin/sh" shebang. This may still be a symlink to bash (or some other shell). - Also replace the redirection to "/dev/stderr" with a POSIX redirection to stderr. "/dev/stderr" is not available on all systems and is also not recognized by all shells (example: ash). On systems without a working "/dev/stderr" the user will not see the prompts etc. - Signed-off-by: Sebastian Kemper sebastian_ml@gmx.net
---
Modified: utils/kamctl/kamctl Modified: utils/kamctl/kamctl.base Modified: utils/kamctl/kamctl.sqlbase Modified: utils/kamctl/kamdbctl
---
Diff: https://github.com/kamailio/kamailio/commit/30857dfe5d0e0e99050fec6437c77f6b... Patch: https://github.com/kamailio/kamailio/commit/30857dfe5d0e0e99050fec6437c77f6b...
---
diff --git a/utils/kamctl/kamctl b/utils/kamctl/kamctl index b115f5a998..9993d56f0f 100755 --- a/utils/kamctl/kamctl +++ b/utils/kamctl/kamctl @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # # control tool for maintaining Kamailio # diff --git a/utils/kamctl/kamctl.base b/utils/kamctl/kamctl.base index a776e10d82..b538cd70d1 100644 --- a/utils/kamctl/kamctl.base +++ b/utils/kamctl/kamctl.base @@ -651,7 +651,7 @@ in SIP_DOMAIN" check_aor() { echo "$1" | $EGREP "^$USERNAME_RE@.*..*" >/dev/null if [ $? -ne 0 ] ; then - echo "error: invalid AoR: $1" > /dev/stderr + echo "error: invalid AoR: $1" >&2 exit 1 fi } @@ -670,7 +670,7 @@ is_aor() { check_sipaor() { echo "$1" | $EGREP "^sip(s)?:$USERNAME_RE@.*..*" >/dev/null if [ $? -ne 0 ] ; then - echo "error: invalid SIP AoR: $1" > /dev/stderr + echo "error: invalid SIP AoR: $1" >&2 exit 1 fi } @@ -681,7 +681,7 @@ check_sipaor() { check_uri() { echo "$1" | $EGREP "^sip(s)?:($USERNAME_RE@)?.*..*" > /dev/null if [ $? -ne 0 ] ; then - echo "error: invalid SIP URI: $1" > /dev/stderr + echo "error: invalid SIP URI: $1" >&2 exit 1 fi } diff --git a/utils/kamctl/kamctl.sqlbase b/utils/kamctl/kamctl.sqlbase index f821d2a799..258366b999 100644 --- a/utils/kamctl/kamctl.sqlbase +++ b/utils/kamctl/kamctl.sqlbase @@ -38,9 +38,9 @@ prompt_pw() { if [ -z "$DBRWPW" ] ; then savetty=`stty -g` if [ -z "$1" ] ; then - printf "Password: " > /dev/stderr + printf "Password: " >&2 else - printf "$1: " > /dev/stderr + printf "$1: " >&2 fi stty -echo read DBRWPW diff --git a/utils/kamctl/kamdbctl b/utils/kamctl/kamdbctl index cac33fd1ce..a8d429a728 100755 --- a/utils/kamctl/kamdbctl +++ b/utils/kamctl/kamdbctl @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # # control tool for maintaining Kamailio databases #