]> gitweb.hhaalo.de Git - simple-backup.git/commitdiff
add: Prompt Color
authorBastian Dehn <hhaalo@arcor.de>
Sun, 22 Jul 2018 09:53:30 +0000 (11:53 +0200)
committerBastian Dehn <hhaalo@arcor.de>
Sun, 22 Jul 2018 09:53:30 +0000 (11:53 +0200)
backup

diff --git a/backup b/backup
index f464605c952914c4cb71b6cc3c9ba33acf2d1553..df5fba26c8c19b87d14c2cea12844265643a7dc3 100755 (executable)
--- 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