qubes-firewall 857 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #!/bin/bash
  2. #
  3. # chkconfig: 345 92 92
  4. # description: Starts Qubes Firewall monitor
  5. #
  6. # Source function library.
  7. . /etc/rc.d/init.d/functions
  8. # Source Qubes library.
  9. . /usr/lib/qubes/init/functions
  10. PIDFILE=/var/run/qubes/qubes-firewall.pid
  11. start()
  12. {
  13. have_qubesdb || return
  14. if qsvc qubes-firewall ; then
  15. echo -n $"Starting Qubes Firewall monitor:"
  16. /sbin/ethtool -K eth0 sg off
  17. /usr/sbin/qubes-firewall &
  18. success
  19. echo ""
  20. fi
  21. }
  22. stop()
  23. {
  24. if [ -r $PIDFILE ]; then
  25. echo -n "Stopping Qubes Firewall monitor:"
  26. # shellcheck disable=SC2015
  27. kill -9 "$(cat "$PIDFILE")" 2>/dev/null && success || failure
  28. echo ""
  29. fi
  30. return 0
  31. }
  32. case "$1" in
  33. start)
  34. start
  35. ;;
  36. stop)
  37. stop
  38. ;;
  39. *)
  40. echo $"Usage: $0 {start|stop}"
  41. exit 3
  42. ;;
  43. esac
  44. # shellcheck disable=SC2086
  45. exit $RETVAL