You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
1.1 KiB

  1. #!/bin/sh /etc/rc.common
  2. # Copyright 2020 Google LLC.
  3. # Copyright (C) 2021 CZ.NIC z.s.p.o. (https://www.nic.cz/)
  4. # SPDX-License-Identifier: Apache-2.0
  5. USE_PROCD=1
  6. START=80
  7. start_service() {
  8. local state_file
  9. local port
  10. local std_err std_out
  11. config_load tailscale
  12. config_get_bool std_out "settings" log_stdout 1
  13. config_get_bool std_err "settings" log_stderr 1
  14. config_get port "settings" port 41641
  15. config_get state_file "settings" state_file /etc/tailscale/tailscaled.state
  16. /usr/sbin/tailscaled --cleanup
  17. procd_open_instance
  18. procd_set_param command /usr/sbin/tailscaled
  19. # Set the port to listen on for incoming VPN packets.
  20. # Remote nodes will automatically be informed about the new port number,
  21. # but you might want to configure this in order to set external firewall
  22. # settings.
  23. procd_append_param command --port "$port"
  24. procd_append_param command --state "$state_file"
  25. procd_set_param respawn
  26. procd_set_param stdout "$std_out"
  27. procd_set_param stderr "$std_err"
  28. procd_close_instance
  29. }
  30. stop_service() {
  31. /usr/sbin/tailscaled --cleanup
  32. }