nQuake / server-linux

nQuake (QuakeWorld) server for Linux
http://www.nquake.com/
39 stars 14 forks source link

Crontab command is broken with Non-Interactive option #8

Closed qb411 closed 6 years ago

qb411 commented 6 years ago

Hi there,

I'm going to submit a change for this, but the cron.d addition does not properly function with the -N flag on the script. Specifically this section:

[ -d "/etc/cron.d" ] && {
  nqecho
  nqnecho "Add nQuake server to crontab (ensures servers are always on) [y/N]: "
  read addcron
  [ "${addcron}" = "y" ] && {
    echo "*/10 * * * * \$(cat ~/.nquakesv/install_dir)/start_servers.sh >/dev/null 2>&1" | sudo tee /etc/cron.d/nquakesv >/dev/null
  }
}

This needs to be updated to honor the -N value when passed to the installer. I'm trying to automate the installation with flags or defaults as part of a automated build (cloudformation script) and I want to make sure this piece works with the non-interactive method as well.

liback commented 6 years ago

Had a brief look at this and I think your PR isn't complete, it just adds the default value without using it. I'll see if I can fix it in the next couple days.