????

Your IP : 18.227.72.27


Current Path : /proc/self/root/usr/lib/Acronis/BackupAndRecovery/
Upload File :
Current File : //proc/self/root/usr/lib/Acronis/BackupAndRecovery/webcpprecapturehost

#/bin/bash

unset LD_PRELOAD

DIR="$(dirname "${BASH_SOURCE[0]}")"

vmid=$(echo $1 | awk '{print tolower($0)}')
script="$DIR/prepostdata.py"
action="pre"

runPreCaptureData() {
    prlctl list -a -o uuid 2>/dev/null | grep $vmid >/dev/null 2>&1

    if [ $? -eq 0 ]; then
      prlctl exec $vmid "python <(echo $(echo "$(cat $script)"|gzip -c|base64 -w 0)|base64 -d|gunzip -c) $action"
    else
      python $script $action
    fi
}

output=$(runPreCaptureData 2>&1)
exit_code=$?
if [ ${exit_code} -ne 0 ]; then
  echo "${0}: ${output}"
  exit ${exit_code}
fi