#!/usr/bin/env bash
# Stop RSPC. All proxied traffic (HTTP, TCP, UDP) stops until it is started again.
source "$(dirname "${BASH_SOURCE[0]}")/lib.sh"
require_root
require_installed

if [[ ${1:-} != "--yes" ]]; then
  warn "stopping RSPC interrupts ALL routed applications and the panel"
  confirm "Stop RSPC?" || exit 0
fi
systemctl stop "$RSPC_SERVICE"
ok "RSPC stopped (start again: sudo $RSPC_HOME/scripts/start.sh)"
