Skip to content

Commit

Permalink
Added code to create files needed to restore the DNS zones
Browse files Browse the repository at this point in the history
  • Loading branch information
cshandley-uk committed Nov 27, 2023
1 parent eb40cb4 commit 37de8b9
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions jb5_to_cpanel_convertor.sh
Expand Up @@ -261,6 +261,23 @@ function CreateSSLcerts() {
done
}

function CreateDNSZones() {
DirPath="$1"
ConfigPath="$2"

echo "Creating DNS zones"

for FILE in $(ls -1 "$DirPath"/*.zone); do
FileName="${FILE##*/}"
DstFile="$ConfigPath/dnszones/${FileName%.*}.db"

echo " Creating '$DstFile'"
mv "$FILE" "$DstFile"
Err=$?
[[ $Err -gt 0 ]] && Error "An error occurred"
done
}

# Parse arguments
FilePath="$1"
DestDir="$2"
Expand Down Expand Up @@ -335,6 +352,9 @@ if [[ -d "$JB5Backup/jetbackup.configs/domain" ]]; then
CreateSSLcerts "$JB5Backup/jetbackup.configs/domain" "$CPanelDir"
fi

if [[ -d "$JB5Backup/domain" ]]; then
CreateDNSZones "$JB5Backup/domain" "$CPanelDir"
fi
echo "Creating final cPanel backup archive...";
Archive "cpmove-$AccountName.tar.gz"
echo "Converting Done!"
Expand Down

0 comments on commit 37de8b9

Please sign in to comment.