Move entrypoint script to common/bin directory
Also, finalized stuff, KEK.
This commit is contained in:
parent
fb09922bbf
commit
7e4554cf70
|
@ -0,0 +1,19 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
LOGGER_TARGET_FILE="/var/tests/exec-log.txt"
|
||||||
|
|
||||||
|
if [[ $LOG_EVERYTHING == "" || $LOG_EVERYTHING == "false" ]]; then
|
||||||
|
exec "$@"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# based on https://gitlab.com/friendly-telegram/friendly-telegram/-/blob/master/install.sh#L43-49, but a bit modified
|
||||||
|
# for our use case
|
||||||
|
log() {
|
||||||
|
# Runs the arguments and spins once per line of stdout (tee'd to logfile), also piping stderr to logfile
|
||||||
|
{ "$@" 2>>$LOGGER_TARGET_FILE || return $?; } | while read -r line; do
|
||||||
|
spin
|
||||||
|
printf "%s\n" "$line" >> $LOGGER_TARGET_FILE
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
log "$@"
|
|
@ -1,7 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
LOGGER_TARGET_FILE="/var/tests/exec-log.txt"
|
|
||||||
|
|
||||||
if [[ $LOG_EVERYTHING == "" || $LOG_EVERYTHING == "false" ]]; then
|
|
||||||
exec "$@"
|
|
||||||
fi
|
|
Loading…
Reference in New Issue