Well tonight I was making a script to change GPIO pins on bootup.
/etc/rc.d/gpiocfg
I was writing the outline for an rc.d startup script, so I wrote the file premise in the /etc/rc.d directory.
I had also chmod 755 & chmod +x 'ed the file in preparation for rc.d scripting.
When I rebooted for another reason, the script ran. I was not expecting it without the rest of the dummy rc.d entries.
Not too proud to say I learned something by accident tonight.
I really didn't want a full blown service or PID and the small script worked great. Changed the pin state and showed status.
The pin states might change later these are just safer boot settings with stuff connected.
Have I done it the wrong way? Do I really need to go back and use all this stuff:
https://www.freebsd.org/doc/en_US.ISO8859-1/articles/rc-scripting/rcng-dummy.html
/etc/rc.d/gpiocfg
Code:
#!/bin/sh
gpioctl -c 0 OUT PP
gpioctl -c 1 OUT PP
gpioctl -c 2 OUT PP
gpioctl -c 3 OUT PP
gpioctl -lv
I had also chmod 755 & chmod +x 'ed the file in preparation for rc.d scripting.
When I rebooted for another reason, the script ran. I was not expecting it without the rest of the dummy rc.d entries.
Not too proud to say I learned something by accident tonight.
I really didn't want a full blown service or PID and the small script worked great. Changed the pin state and showed status.
The pin states might change later these are just safer boot settings with stuff connected.
Have I done it the wrong way? Do I really need to go back and use all this stuff:
https://www.freebsd.org/doc/en_US.ISO8859-1/articles/rc-scripting/rcng-dummy.html