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.

26 lines
640 B

  1. #!/bin/sh /etc/rc.common
  2. # Copyright (C) 2011-2014 OpenWrt.org
  3. START=00
  4. USE_PROCD=1
  5. PROG=/sbin/rngd
  6. start_service() {
  7. local enabled=$(uci -q get system.@rngd[0].enabled)
  8. local precmd=$(uci -q get system.@rngd[0].precmd)
  9. local device=$(uci -q get system.@rngd[0].device)
  10. local watermark=$(uci -q get system.@rngd[0].fill_watermark)
  11. [ "$enabled" = "1" ] || return
  12. [ -z "$precmd" ] || ${precmd} ${device}
  13. [ -z "$device" ] || device="-r ${device}"
  14. [ -z "$watermark" ] || watermark="-W ${watermark}"
  15. procd_open_instance
  16. procd_set_param command "$PROG" -f ${device} ${watermark}
  17. procd_set_param stderr 1
  18. procd_close_instance
  19. }