# Evaluating rc.conf before rebooting...



## urbanriot (Jun 23, 2013)

I have a few FreeBSD routers in remote locations that require a long list of routes added to the routing table via rc.conf at boot. When I make a number of adjustments or edits, I have a fear that I've made an error or accidentally inserted a character into my rc.conf that will break boot so I'll have to travel there...


Is there a way to evaluate rc.conf prior to rebooting a system to determine if I added something stupid? There was a time I had broken a router by accidentally adding a ` to the top of my rc.conf and missed it since it wasn't in an area I was working on. 
Is there a better way to add persistent custom routes rather than rc.conf?

Thank you!


----------



## wblock@ (Jun 23, 2013)

/etc/rc.conf is a shell script.  It normally just sets variables, so running it with `sh /etc/rc.conf` may find errors.  Add -x to see what it's doing.


----------



## urbanriot (Jun 24, 2013)

... n Nothing happened, the response was the same as if I'd just hit enter by itself.


----------



## wblock@ (Jun 24, 2013)

That means there were no errors found.   Try it with -x.  Better yet, try adding or removing a single quote and see if it notices.  Um... best to do that on a copy in case the intentional error is forgotten.


----------



## ShelLuser (Jun 24, 2013)

Just a small side-comment, one of the very first things I was taught about Unix environments: "No news is good news". By default, and per definition, a Unix program or script won't output a single thing if you tell it to do something and it has successfully performed that task.

Of course that was more than 20 years ago and several things changed in the meantime, but in general this "rule" still holds true today (although many programs and scripts have turned a bit more user friendly over time).


----------



## urbanriot (Jun 24, 2013)

wblock@ said:
			
		

> That means there were no errors found.



Thanks gents. I rebooted the system and it started up fine so it must have been error-free as you said.


----------

