Added logging for UpdateAll sh
This commit is contained in:
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
logs/*
|
||||
19
UpdateAll.sh
19
UpdateAll.sh
@@ -6,8 +6,15 @@
|
||||
# @author: Bram Prieshof #
|
||||
##########################
|
||||
|
||||
#Dirs
|
||||
WorkDir=$(dirname $0)
|
||||
LogDir=$WorkDir/logs
|
||||
#Load functions
|
||||
source $(dirname $0)/functions.sh
|
||||
source $WorkDir/functions.sh
|
||||
#Create Log folder
|
||||
if [ ! -d $LogDir ]; then
|
||||
mkdir $LogDir
|
||||
fi
|
||||
|
||||
#ID list of excluded VM/CT's
|
||||
ExcludeList=()
|
||||
@@ -47,7 +54,7 @@ while true; do
|
||||
UpdateAPP=true
|
||||
break;;
|
||||
[Bb]* )
|
||||
UpdatePKG=true
|
||||
UpdatePKG=true
|
||||
UpdateAPP=true
|
||||
break;;
|
||||
* ) echo "Please answer with (A)ll, (C)T`s or (V)M`s.";;
|
||||
@@ -61,10 +68,10 @@ if $UpdateCT; then
|
||||
if [[ "${ExcludeList[*]}" =~ $CTID ]]; then echo "Notice: $CTID excluded"; continue; fi
|
||||
#DEBUG echo "Task for $CTID"
|
||||
if $UpdatePKG; then
|
||||
CT-UpdatePackages $CTID
|
||||
CT-UpdatePackages $CTID | tee "$LogDir"/"$CTID"_Pkgs.log
|
||||
fi
|
||||
if $UpdateAPP; then
|
||||
CT-UpdateApplicatons $CTID
|
||||
CT-UpdateApplicatons $CTID | tee "$LogDir"/"$CTID"_Apps.log
|
||||
fi
|
||||
done
|
||||
fi
|
||||
@@ -76,10 +83,10 @@ if $UpdateVM; then
|
||||
if [[ "${ExcludeList[*]}" =~ $VMID ]]; then echo "Notice: $VMID excluded"; continue; fi
|
||||
#DEBUG echo "Task for $VMID"
|
||||
if $UpdatePKG; then
|
||||
VM-UpdatePackages $VMID
|
||||
VM-UpdatePackages $VMID | tee "$LogDir"/"$VMID"_Pkgs.log
|
||||
fi
|
||||
if $UpdateAPP; then
|
||||
VM-UpdateApplicatons $VMID
|
||||
VM-UpdateApplicatons $VMID | tee "$LogDir"/"$VMID"_Apps.log
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user