home/.concession/common_task.sh
2018-09-27 21:02:24 -05:00

25 lines
592 B
Bash
Executable File

#! /usr/bin/env bash
#
# wmstartup service common functions
# Copyright (C) 2018 salt <salt@lap-th-e560-0>
#
# Distributed under terms of the MIT license.
#
# Basic logging service. Do not override unless necessary
function tsk_log() {
if [ -z ${1+x} ]; then return 1; fi
out=1
if ! [ -z ${2+x} ]; then out="$2"; fi
col_reset="\e[0m"
col_tskname="\e[96m"
col_message="\e[39m"
if ! [ "$out" -eq "1" ]; then col_message="\e[31m"; fi
if [ "$out" -eq "0" ]; then
out=1
col_message="\e[37m"
fi
cnc_log "${col_tskname}${task}${col_reset}: ${col_message}${1}${col_reset}" >&${out}
}