shellcheck v0.7.1 complains about a bunch of issues:
SC2154: status is referenced but not assigned.
SC2181: Check exit code directly with e.g. 'if mycmd;', not indirectly with $?.
SC2207: Prefer mapfile or read -a to split command output (or quote to avoid splitting).
SC2235: Use { ..; } instead of (..) to avoid subshell overhead.
SC2236: Use -n instead of ! -z.
The "$status" variable disappeared in d4763aba14.
The init scripts of ngcp-rtpengine-daemon and
ngcp-rtpengine-recording-daemon had a logic bug, where a failing stop
action didn't properly return, but continued execution of the following
firewalling code (ngcp-rtpengine-iptables-setup). Thanks to Guillem
Gover for spotting this one. While at it, no longer execute under
'set -e'.
Change-Id: Ia50e76f615564a288627e6e42ec8f7eb082de74c
`exit -1` is out of range in shell scripts and returning
with 255, while init scripts are supposed to be exit with `1`
and similar on errors.
We're following
http://refspecs.linuxbase.org/LSB_3.0.0/LSB-PDA/LSB-PDA/iniscrptact.html
and returning with exit code 6 for configuration issues.
Change-Id: I8eda8e059c4ea10b9ddbddd1306627894073b034
Otherwise we might end up with empty "$TABLE", while we're
trying to execute:
echo "del $TABLE" > /proc/rtpengine/control
This will fail with `echo: write error: Invalid argument` error then.
Instead set TABLE by default to '0'. Users can
customize this via /etc/sysconfig/rtpengine,
and the file is sourced after we set the default.
Closes#696
Change-Id: I2f9bb810757507bcc01509ce02676af0d711f515
If you don't need to use transcoding and recording, so you don't need
to install ffmpeg libraries. Just change with_transcoding to 0.
Also some changes according directory name inside tar.gz archive
* warning: cachefile appears unused. Verify it or export it. [SC2034]
* warning: Double quote to prevent globbing and word splitting. [SC2086]
* removed unnecessary space
Change-Id: I71276ca08d1a5599bf1034403d2973ef78d8079e
- Add missing quotes.
- Switch some problematic usages to use bash arrays.
- Override shellcheck errors (these might need fixing in the future).
Change-Id: Id451ff9f4c5d5ef9b3826544908d64e9c08c5797