vde.init 632 B

1234567891011121314151617181920212223242526
  1. #!/sbin/openrc-run
  2. # Copyright 1999-2013 Gentoo Foundation
  3. # Distributed under the terms of the GNU General Public License v2
  4. depend() {
  5. after net.${VDE_TAP}
  6. }
  7. start() {
  8. ebegin "Starting vde"
  9. [ "${VDE_MODPROBE_TUN}" = "yes" ] && modprobe tun
  10. start-stop-daemon --start --quiet \
  11. --exec /usr/bin/vde_switch -- ${VDE_OPTS}
  12. eend $? "Failed to start vde"
  13. chmod -R ${VDE_SOCK_CHMOD} /var/run/vde.ctl
  14. chown -R ${VDE_SOCK_CHOWN} /var/run/vde.ctl
  15. }
  16. stop() {
  17. ebegin "Stopping vde"
  18. start-stop-daemon --stop --quiet --exec /usr/bin/vde_switch
  19. [ "${VDE_MODPROBE_TUN}" = "yes" ] && modprobe -r tun
  20. eend $? "Failed to stop vde"
  21. }