luckman212 / Netgate-SG2100-scripts

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

LED Control Scripts for Netgate SG-2100

About

Inspired by this thread on r/Netgate, these are some simple control scripts to turn LEDs on/off to increase WAF. Adjust as desired, the day script below will apply a dim green color to the leftmost LED. You can play with the brightness by adjusting duty (0-255) and RGB values by replicating the gpioctl command for /dev/gpioc2 6,7,8 (R,G,B).

Setup

  1. ssh / console to your SG-2100
  2. choose option 8 (shell)
  3. cat >/root/night
  4. paste the text below:
    #!/bin/sh
    l=0
    while [ $l -le 8 ]; do
      gpioctl -f /dev/gpioc2 $l duty 0 >/dev/null
      l=$(( l + 1 ))
    done
    
  5. press ⌃CTRL+D
  6. cat >/root/day
  7. paste the text below:
    #!/bin/sh
    /root/night
    sysctl -q dev.gpio.2.led.2.pwm=1
    gpioctl -f /dev/gpioc2 7 duty 1 >/dev/null
    
  8. chmod +x /root/day /root/night
  9. Schedule with Cron package for whatever times desired.

About


Languages

Language:Shell 100.0%