Skip to content

Commit

Permalink
Revert and improve commit 22e2b97, because …
Browse files Browse the repository at this point in the history
 … I did not understand the logic / considerations for my own code any more
  • Loading branch information
Olf0 authored Apr 13, 2023
1 parent bace718 commit 98cbcf5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions bin/sailfishos-chum-gui-installer
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 98cbcf5

Please sign in to comment.