Compare commits

...

2 Commits

2 changed files with 18 additions and 0 deletions

View File

@ -3,6 +3,7 @@
set -x
fifo=""
source ./log_helpers.sh
source ./git_helpers.sh
source ./opkg_helpers.sh
source ./update_helpers.sh

17
log_helpers.sh Executable file
View File

@ -0,0 +1,17 @@
#!/bin/bash
# set -x
log() {
local log_file=/var/log/update_controller.log
if [ -f "$log_file" ]; then
touch $log_file
fi
if [ $(wc -l < $log_file) > 100000 ]; then
# remove first line
sed -e 1d -i $log_file
fi
message="$(date +'%D_%T'): $*"
printf "$message\n"
printf "$message\n" >> $log_file
}
# log "test message1" "test message2"