Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Change directory to root (to prevent unzip command errors)
- cd /
- # Stop CrashPlan Engine
- varCommand="/var/packages/CrashPlan/scripts/start-stop-status.sh stop"
- echo "Stopping CrashPlan Engine [${varCommand}]"
- ${varCommand}
- # Set directory path variables
- varTargetDir="/var/packages/CrashPlan/target/"
- echo "Target Dir: ${varTargetDir}"
- varUpgradeDir="${varTargetDir}upgrade/"
- echo "Upgrade Dir: ${varUpgradeDir}"
- # Pre-cleanup - Remove all subfolders from target/upgrade directory
- varCommand="rm -r ${varUpgradeDir}*/"
- echo "Cleaning up subfolders [${varCommand}]"
- ${varCommand}
- # Get the name of the latest upgrade archive
- varUpdatefile=$(find ${varUpgradeDir} -name "*.jar" | tail -n 1)
- echo "Update found: ${varUpdatefile}"
- # Extract the update files
- varCommand="unzip -o ${varUpdatefile} *.jar -d ${varTargetDir}lib/"
- echo "Extracting libraries [${varCommand}]"
- ${varCommand}
- varCommand="unzip -o ${varUpdatefile} lang/* -d ${varTargetDir}"
- echo "Extracting libraries [${varCommand}]"
- ${varCommand}
- # Rename java archive
- varCommand="mv ${varUpdatefile} ${varUpdatefile}.extracted"
- echo "Renaming java archive [${varCommand}]"
- ${varCommand}
- # Delete all other java archives
- varCommand="rm -r ${varUpgradeDir}*.jar"
- echo "Deleting all other java archives [${varCommand}]"
- ${varCommand}
- # Start CrashPlan Engine
- varCommand="/var/packages/CrashPlan/scripts/start-stop-status.sh start"
- echo "Starting CrashPlan Engine [${varCommand}]"
- ${varCommand}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement