Advertisement
Valiante

Synology Crashplan Fix

Dec 14th, 2015
254
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.46 KB | None | 0 0
  1. # Change directory to root (to prevent unzip command errors)
  2. cd /
  3.  
  4. # Stop CrashPlan Engine
  5. varCommand="/var/packages/CrashPlan/scripts/start-stop-status.sh stop"
  6. echo "Stopping CrashPlan Engine [${varCommand}]"
  7. ${varCommand}
  8.  
  9. # Set directory path variables
  10. varTargetDir="/var/packages/CrashPlan/target/"
  11. echo "Target Dir: ${varTargetDir}"
  12. varUpgradeDir="${varTargetDir}upgrade/"
  13. echo "Upgrade Dir: ${varUpgradeDir}"
  14.  
  15. # Pre-cleanup - Remove all subfolders from target/upgrade directory
  16. varCommand="rm -r ${varUpgradeDir}*/"
  17. echo "Cleaning up subfolders [${varCommand}]"
  18. ${varCommand}
  19.  
  20. # Get the name of the latest upgrade archive
  21. varUpdatefile=$(find ${varUpgradeDir} -name "*.jar" | tail -n 1)
  22. echo "Update found: ${varUpdatefile}"
  23.  
  24. # Extract the update files
  25. varCommand="unzip -o ${varUpdatefile} *.jar -d ${varTargetDir}lib/"
  26. echo "Extracting libraries [${varCommand}]"
  27. ${varCommand}
  28. varCommand="unzip -o ${varUpdatefile} lang/* -d ${varTargetDir}"
  29. echo "Extracting libraries [${varCommand}]"
  30. ${varCommand}
  31.  
  32. # Rename java archive
  33. varCommand="mv ${varUpdatefile} ${varUpdatefile}.extracted"
  34. echo "Renaming java archive [${varCommand}]"
  35. ${varCommand}
  36.  
  37. # Delete all other java archives
  38. varCommand="rm -r ${varUpgradeDir}*.jar"
  39. echo "Deleting all other java archives [${varCommand}]"
  40. ${varCommand}
  41.  
  42. # Start CrashPlan Engine
  43. varCommand="/var/packages/CrashPlan/scripts/start-stop-status.sh start"
  44. echo "Starting CrashPlan Engine [${varCommand}]"
  45. ${varCommand}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement