From 23ef3eac3537bf50399133dd47bdef67fc4b2d7b Mon Sep 17 00:00:00 2001 From: Bastian Dehn Date: Sun, 22 Jul 2018 11:53:30 +0200 Subject: [PATCH] add: Prompt Color --- backup | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/backup b/backup index f464605..df5fba2 100755 --- a/backup +++ b/backup @@ -97,7 +97,7 @@ BackupVMDiscs() local DiskType="" for Disk in $Disks; do - printf "Disk %s von %s wird gesichert\n\n" "$Disk" "$VM" + printf "Disk ${YELLOW}%s${RESET} von ${LIGHTBLUE}%s${RESET} wird gesichert\n\n" "$Disk" "$VM" DiskType=$(ssh $remoteLogin virsh vol-info $Disk \ | grep Type | awk '{print $2}') @@ -120,7 +120,7 @@ BackupOnlineVMs() for VM in $onlineVM; do printfStripLine - printf "Rechner %s; %s ist online\n" "$remoterechner" "$VM" + printf "Rechner ${LIGHTPURPLE}%s${RESET}; ${LIGHTBLUE}%s${RESET} ist ${LIGHTGREEN}online${RESET}\n" "$remoterechner" "$VM" printf "Fahre %s herunter\n\n" "$VM" ssh $remoteLogin virsh shutdown $VM | WaitVMShutdown BackupVMDiscs @@ -138,7 +138,7 @@ BackupOfflineVMs() for VM in $offlineVM; do printfStripLine - printf "Rechner %s; %s ist offline\n\n" "$remoterechner" "$VM" + printf "Rechner ${LIGHTPURPLE}%s${RESET}; ${LIGHTBLUE}%s${RESETt} ${LIGHTRED}offline${RESET}\n\n" "$remoterechner" "$VM" BackupVMDiscs printfStripLine done @@ -158,7 +158,7 @@ BackupDirectoryPath() | sed 's/\//-/g').log" printfStripLine - printf "Rechner %s; Pfad %s wird gesichert\n\n" "$remoterechner" "$pfad" + printf "Rechner ${LIGHTPURPLE}%s${RESET}; Pfad ${YELLOW}%s${RESET} wird gesichert\n\n" "$remoterechner" "$pfad" rsync --archive --verbose --sparse --acls --hard-links --relative \ --human-readable --log-file=$logFile --filter="- *.qcow2" \ @@ -172,7 +172,7 @@ BackupPackages() local readonly packPath="$backRemotePCPath/packages" printfStripLine - printf "Rechner %s; Packages wird gesichert \n\n" "$remoterechner" + printf "Rechner ${LIGHTPURPLE}%s${RESET}; ${YELLOW}Packages${RESET} wird gesichert \n\n" "$remoterechner" mkdir --parents $packPath dpkg --get-selections > $packPath/package.list @@ -246,6 +246,12 @@ CleanUpBackups() main() { + YELLOW="\e[0;33m" + LIGHTBLUE="\e[1;34m" + LIGHTRED="\e[1;31m" + LIGHTPURPLE="\e[1;35m" + LIGHTGREEN="\e[1;32m" + RESET="\e[0m" SetDefaultVariables ReadArguments -- 2.39.5