From d03a1a6e3b734d8582a151520731063fd4a16746 Mon Sep 17 00:00:00 2001 From: bunkerity Date: Wed, 7 Jul 2021 13:47:37 +0200 Subject: [PATCH] linux - add jobs.log --- helpers/bunkerized-nginx | 24 ++++++++++++------------ helpers/install.sh | 3 +++ 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/helpers/bunkerized-nginx b/helpers/bunkerized-nginx index fa415db..571d351 100644 --- a/helpers/bunkerized-nginx +++ b/helpers/bunkerized-nginx @@ -1,22 +1,22 @@ #!/bin/bash function do_and_check_cmd() { - if [ "$CHANGE_DIR" != "" ] ; then - cd "$CHANGE_DIR" - fi + if [ "$CHANGE_DIR" != "" ] ; then + cd "$CHANGE_DIR" + fi if [ "$AS_ROOT" != "" ] ; then output=$("$@" 2>&1) else - output=$(su -s "/bin/bash" -c "$1" nginx 2>&1) + output=$(su -s "/bin/bash" -c "$1" nginx 2>&1) fi - ret="$?" - if [ $ret -ne 0 ] ; then - echo "[!] Error from command : $*" - echo "$output" - exit $ret - fi - echo "$output" - return 0 + ret="$?" + if [ $ret -ne 0 ] ; then + echo "[!] Error from command : $*" + echo "$output" + exit $ret + fi + echo "$output" + return 0 } # Check if we are root diff --git a/helpers/install.sh b/helpers/install.sh index 2b4fcd6..7be93d5 100644 --- a/helpers/install.sh +++ b/helpers/install.sh @@ -221,6 +221,7 @@ do_and_check_cmd find /etc/nginx -type d -exec chmod 0775 {} \; echo "[*] Prepare log files and folders" do_and_check_cmd touch /var/log/access.log do_and_check_cmd touch /var/log/error.log +do_and_check_cmd touch /var/log/jobs.log if [ ! -e "/var/log/nginx" ] ; then do_and_check_cmd mkdir /var/log/nginx fi @@ -229,8 +230,10 @@ do_and_check_cmd touch /var/log/nginx/error.log do_and_check_cmd chown -R root:nginx /var/log/nginx do_and_check_cmd chown root:nginx /var/log/access.log do_and_check_cmd chown root:nginx /var/log/error.log +do_and_check_cmd chown root:nginx /var/log/jobs.log do_and_check_cmd chmod 770 /var/log/access.log do_and_check_cmd chmod 770 /var/log/error.log +do_and_check_cmd chmod 770 /var/log/jobs.log do_and_check_cmd chmod -R 770 /var/log/nginx # Prepare Let's Encrypt files and folders