From 98cbcf52af6958f2a64c005642b09762e5ba0080 Mon Sep 17 00:00:00 2001 From: olf Date: Thu, 13 Apr 2023 22:55:50 +0200 Subject: [PATCH] =?UTF-8?q?Revert=20and=20improve=20commit=2022e2b97,=20be?= =?UTF-8?q?cause=20=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit … I did not understand the logic / considerations for my own code any more --- bin/sailfishos-chum-gui-installer | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bin/sailfishos-chum-gui-installer b/bin/sailfishos-chum-gui-installer index 9f26de2..f5de5cc 100644 --- a/bin/sailfishos-chum-gui-installer +++ b/bin/sailfishos-chum-gui-installer @@ -54,14 +54,15 @@ logfile="$2" umask 113 [ "$PWD" = / ] || cd / # Set PWD to /, if not already -# Prefix first output with a linebreak, dashes and another linebreak, if logfile size > 0 +# Prefix first output with a line of underscores and an empty line, if logfile size > 0 +linebreaks="" if [ -s "$logfile" ] -then printf '\n%s\n\n' "-----------------------------" +then linebreaks='_____________________________\n\n' fi # Write first entry to logfile: logentry="[Info] PID $mypid is logging to $logfile on" -if printf '%s %s\n' "$logentry" "$(date -Iseconds)" +if printf "${linebreaks}%s\n" "$logentry $(date -Iseconds)" then systemd-cat -t "$called" -p 6 printf '%s\n' "$logentry" else systemd-cat -t "$called" -p 4 printf '%s\n' "[Warning] PID $mypid failed to write to $logfile" fi