fn_update_functions 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. #!/bin/bash
  2. # LGSM fn_update_functions function
  3. # Author: Daniel Gibbs
  4. # Website: http://gameservermanagers.com
  5. # Version: 190515
  6. # Description: Deletes the functions dir to allow re-downloading of functions from GitHub.
  7. fn_printdots "Updating functions"
  8. fn_scriptlog "Updating functions"
  9. sleep 1
  10. echo -ne "\n"
  11. rm -rfv "${rootdir}/functions/"*
  12. exitcode=$?
  13. if [ "${exitcode}" == "0" ]; then
  14. fn_printok "Updating functions"
  15. fn_scriptlog "Successfull! Updating functions"
  16. else
  17. fn_printokfail "Updating functions"
  18. fn_scriptlog "Failure! Updating functions"
  19. fi
  20. sleep 1
  21. fn_printdots "Checking for ${selfname} script update"
  22. fn_scriptlog "Checking for ${selfname} script update"
  23. currentversion=$(wget -O- -q https://gameservermanagers.com/dl/${selfname}|grep version=)
  24. currentversion
  25. if [ "${version}" == "${currentversion}" ]; then
  26. fn_printok "New version of ${selfname} available"
  27. fn_scriptlog "New version of ${selfname} available"
  28. else
  29. fn_printok "${selfname} is up to date"
  30. fn_printok "${selfname} is up to date"
  31. fi
  32. echo -ne "\n"