first commit
This commit is contained in:
19
gaboshlib/g_echo_error.bashfunc
Normal file
19
gaboshlib/g_echo_error.bashfunc
Normal file
@@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
|
||||
function g_echo_error {
|
||||
echo -en "\033[97m$(g_date_print) \033[31mERROR:" 1>&2
|
||||
cat <<< "$@" 1>&2
|
||||
echo -en "\033[0m" 1>&2
|
||||
g_logger ERROR: $@
|
||||
if ! [ $0 = /usr/local/bin/notify.sh ]
|
||||
then
|
||||
if [ -x /data/debian/usr/local/bin/notify.sh ]
|
||||
then
|
||||
cat <<< "$(date "+%F %T") $(hostname) $0($$) ERROR: $@ " | debian-chroot.sh /usr/local/bin/notify.sh
|
||||
elif [ -x /usr/local/bin/notify.sh ]
|
||||
then
|
||||
cat <<< "$(date "+%F %T") $(hostname) $0($$) ERROR: $@" | /usr/local/bin/notify.sh
|
||||
fi
|
||||
fi
|
||||
[ -z $DISPLAY ] || zenity --error --ellipsize --text="$@"
|
||||
}
|
||||
Reference in New Issue
Block a user