message: scripts: rpi: setup.sh: add option to install and enable the server service
diff: @@ -28,6 +28,8 @@ print_help() {
  echo " Install udev rules for devices permissions"
  echo "-na|--no-apt"
  echo " Do not install apt packages"
  + echo "-es|--enable-server"
  + echo " Enable the server service"
  echo ""
  }
  @@ -65,6 +67,7 @@ yes_or_exit() {
  setup() {
  NUM_JOBS=$(nproc --all)
  no_apt="False"
  + enable_server="False"
  while [[ $# -gt 0 ]]
  do
  @@ -115,6 +118,10 @@ setup() {
  no_apt="True"
  shift # next argument
  ;;
  + -es|--enable-server)
  + enable_server="True"
  + shift # next argument
  + ;;
  *) # unknown option
  POSITIONAL+=("$1") # save it in an array for later
  shift # past argument
  @@ -195,6 +202,13 @@ setup() {
  if [[ "${udev_rules}" == "True" ]]; then
  sudo make install-udev-rules
  fi
  +
  + popd
  +
  + if [[ "${enable_server}" == "True" ]]; then
  + sudo cp ${source_dir}/utils/raspberrypi/tof-server.service /etc/systemd/system/
  + sudo systemctl enable tof-server
  + fi
  }
  setup $@
  