From c80b84c5065ea5ba726f059cd5b2b7172b294e53 Mon Sep 17 00:00:00 2001 From: Hippolyte Chauvin Date: Sun, 7 May 2023 22:08:11 +0200 Subject: [PATCH] Fonction echol pour afficher du texte d'une couleur ; changement de la fonction status --- bin/vncctl | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/bin/vncctl b/bin/vncctl index 82112ef..b891c78 100755 --- a/bin/vncctl +++ b/bin/vncctl @@ -6,6 +6,12 @@ cd "${HOME}/.vnc" || exit 5 # Variables file_base="./$(hostname):1." +echol() { + col="$1" + shift + printf '\033['"${col}"'m%s\033[0m\n' "$*" +} + error() { >&2 printf '\033[1;31m%s\033[0m %s\n' "ERROR:" "$1" shift @@ -44,9 +50,10 @@ start() { status() { log_f="${file_base}log" if is_running; then - tail -f "$log_f" + echol '1;32' "The VNC server is running." + tail "$log_f" else - echo "The VNC server is not running." + echol '1;31' "The VNC server is not running." fi }