diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4cf8dd1 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +logs/* \ No newline at end of file diff --git a/UpdateAll.sh b/UpdateAll.sh index 10f89d9..0772be5 100644 --- a/UpdateAll.sh +++ b/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