Add envvar to disable logging
In case shit gets spammy or whatever
This commit is contained in:
parent
3d5fde695a
commit
adae474436
13
firestarter
13
firestarter
@ -259,6 +259,10 @@ Start or generate a desktop environment configuration
|
|||||||
-d Perform a dry run. This will print the results of all decisions
|
-d Perform a dry run. This will print the results of all decisions
|
||||||
without executing them.
|
without executing them.
|
||||||
|
|
||||||
|
Additionally, firestarter responds to the following environment variables:
|
||||||
|
|
||||||
|
FS_NOLOG If nonempty, create no log files
|
||||||
|
|
||||||
Copyright (c) 2019 rehashedsalt@cock.li
|
Copyright (c) 2019 rehashedsalt@cock.li
|
||||||
Licensed under the MIT License
|
Licensed under the MIT License
|
||||||
https://gitlab.com/rehashedsalt/firestarter
|
https://gitlab.com/rehashedsalt/firestarter
|
||||||
@ -343,7 +347,9 @@ step_execute() {
|
|||||||
err "Failed to create configuration directory \"$g_configdir\"" 52
|
err "Failed to create configuration directory \"$g_configdir\"" 52
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
if ! [ -d "$g_logdir" ]; then
|
if [ -n "$FS_NOLOG" ]; then
|
||||||
|
log "No logs will be created per FS_NOLOG"
|
||||||
|
elif ! [ -d "$g_logdir" ]; then
|
||||||
if ! mkdir -p "$g_logdir" > /dev/null 2>&1; then
|
if ! mkdir -p "$g_logdir" > /dev/null 2>&1; then
|
||||||
err "Failed to create log directory \"$g_logdir\"" 53
|
err "Failed to create log directory \"$g_logdir\"" 53
|
||||||
fi
|
fi
|
||||||
@ -366,8 +372,9 @@ step_execute() {
|
|||||||
step_execute
|
step_execute
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
filename="$(basename -- "$file")"
|
local filename="$(basename -- "$file")"
|
||||||
logfile="$g_logdir/$filename"
|
local logfile="$g_logdir/$filename"
|
||||||
|
[ -n "$FS_NOLOG" ] && logfile="/dev/null"
|
||||||
# Every odd line is the check line
|
# Every odd line is the check line
|
||||||
# Every even one is the exec line
|
# Every even one is the exec line
|
||||||
while read -r checkline; do
|
while read -r checkline; do
|
||||||
|
Loading…
Reference in New Issue
Block a user