linux - fix tests docker cp and pass single -c argument to su
This commit is contained in:
@@ -4,7 +4,7 @@ function do_and_check_cmd() {
|
||||
if [ "$CHANGE_DIR" != "" ] ; then
|
||||
cd "$CHANGE_DIR"
|
||||
fi
|
||||
output=$(su -s "/bin/bash" -c "$@" nginx 2>&1)
|
||||
output=$(su -s "/bin/bash" -c "$1" nginx 2>&1)
|
||||
ret="$?"
|
||||
if [ $ret -ne 0 ] ; then
|
||||
echo "[!] Error from command : $*"
|
||||
@@ -29,20 +29,20 @@ fi
|
||||
|
||||
# Run generator
|
||||
echo "[*] Generate configuration files"
|
||||
do_and_check_cmd /opt/bunkerized-nginx/gen/main.py --settings /opt/bunkerized-nginx/settings.json --templates /opt/bunkerized-nginx/confs --output /etc/nginx --variables /opt/bunkerized-nginx/variables.env
|
||||
do_and_check_cmd "/opt/bunkerized-nginx/gen/main.py --settings /opt/bunkerized-nginx/settings.json --templates /opt/bunkerized-nginx/confs --output /etc/nginx --variables /opt/bunkerized-nginx/variables.env"
|
||||
|
||||
# Run pre-jobs
|
||||
echo "[*] Run pre-jobs"
|
||||
do_and_check_cmd /opt/bunkerized-nginx/entrypoint/pre-jobs.sh
|
||||
do_and_check_cmd "/opt/bunkerized-nginx/entrypoint/pre-jobs.sh"
|
||||
|
||||
# Reload nginx if it's running
|
||||
if [ -f "/tmp/nginx.pid" ] ; then
|
||||
echo "[*] Reload nginx"
|
||||
do_and_check_cmd nginx -s reload
|
||||
do_and_check_cmd "nginx -s reload"
|
||||
# Otherwise start it
|
||||
else
|
||||
echo "[*] Start nginx"
|
||||
do_and_check_cmd nginx -g 'daemon off;'
|
||||
do_and_check_cmd "nginx -g 'daemon off;'"
|
||||
fi
|
||||
|
||||
# Run post-jobs
|
||||
|
||||
Reference in New Issue
Block a user