check_gamedig.sh 725 B

1234567891011121314151617
  1. #!/bin/bash
  2. # LinuxGSM check_gamedig.sh module
  3. # Author: Daniel Gibbs
  4. # Contributors: http://linuxgsm.com/contrib
  5. # Website: https://linuxgsm.com
  6. # Description: Installs Node.js and gamedig
  7. if [ "$(command -v node)" ] && [ "$(command -v npm)" ] && [ "$(node -v | cut -d 'v' -f 2 | cut -d '.' -f 1)" -ge 16 ] && [ ! -f "${lgsmdir}/node_modules/gamedig/bin/gamedig.js" ]; then
  8. echo -e ""
  9. echo -e "${bold}${lightyellow}Installing Gamedig${default}"
  10. fn_script_log_info "Installing Gamedig"
  11. cd "${lgsmdir}" || exit
  12. wget -N --no-check-certificate "https://raw.githubusercontent.com/GameServerManagers/LinuxGSM/${githubbranch}/package.json"
  13. npm install
  14. else
  15. fn_script_log_info "Install Node.js and NPM to enable Gamedig"
  16. fi