Fonction echol pour afficher du texte d'une couleur ; changement de la fonction status
This commit is contained in:
parent
812b4409b4
commit
c80b84c506
1 changed files with 9 additions and 2 deletions
11
bin/vncctl
11
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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue