Advertisement
Guest User

Untitled

a guest
Jan 18th, 2020
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.73 KB | None | 0 0
  1. #!/bin/bash
  2. # Generate a timestamp
  3. now=$(date +"%Y%m%d_%H%M%S")
  4.  
  5. # Stop the server
  6. cd /opt
  7. if [ -d "/opt/SimpleHelp" ]; then
  8. cd SimpleHelp
  9. sh serverstop.sh
  10. cd ..
  11.  
  12. echo "Backing up the SimpleHelp installation to SimpleHelp_backup_$now"
  13. mv SimpleHelp "SimpleHelp_backup_$now"
  14. fi
  15.  
  16. # Fetch the new version
  17. echo "Downloading the latest version"
  18. if [ `uname -m | grep "64"` ]; then
  19. rm -f SimpleHelp-linux-amd64.tar.gz
  20. wget https://simple-help.com/releases/SimpleHelp-linux-amd64.tar.gz
  21. tar -xzf SimpleHelp-linux-amd64.tar.gz
  22. else
  23. rm -f SimpleHelp-linux-tar.gz
  24. wget https://simple-help.com/releases/SimpleHelp-linux.tar.gz
  25. tar -xzf SimpleHelp-linux.tar.gz
  26. fi
  27.  
  28. # Copy across the old configuration folder
  29. if [ -d "/opt/SimpleHelp_backup_$now" ]; then
  30. echo "Copying across configuration files"
  31. cp -R /opt/SimpleHelp_backup_$now/configuration/* /opt/SimpleHelp/configuration
  32.  
  33. # Copy across a legacy license file
  34. if [ -f "/opt/SimpleHelp_backup_$now/shlicense.txt" ]; then
  35. cp /opt/SimpleHelp_backup_$now/shlicense.txt /opt/SimpleHelp/configuration
  36. fi
  37.  
  38. # Copy across any keystore file
  39. if [ -f "/opt/SimpleHelp_backup_$now/keystore" ]; then
  40. cp /opt/SimpleHelp_backup_$now/keystore /opt/SimpleHelp
  41. fi
  42. fi
  43.  
  44. # Start the new server
  45. echo "Starting your new SimpleHelp server"
  46. cd SimpleHelp
  47. sh serverstart.sh
  48. cd ..
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement