Dear Sir/Madam
am using OPNsense 18.1.6-i386 wherein am not able to find setting for enabling me to shut down opnsense at specific time,i.e. after office hours automatically.
do guide me, if this is even possible.
Regs
Ken
If you shut it down, how are you going to restart it?
You need to follow the instructions here to create a cron job - that job will call the shutdown script you will also need to create. The will be a shell script to call the shutdown command.
http://kb.unixservertech.com/other/networking/opnsense/cron-jobs (http://kb.unixservertech.com/other/networking/opnsense/cron-jobs)
Office hours ends at 5:00 PM daily and shutting down is manual everyday. restart would be next day at 9:00 AM. so there is no restart needed.
can you suggest the script that will go for shut down at x hours daily or point me to some eg.
There already is one, the system shutdown script = "/usr/local/etc/rc.halt".
So all you need to do is create the "actions_shutdown.conf" file, which should look like this:
[shutdown]
command:/usr/local/etc/rc.halt
parameters:
type:script
message:cron event shutting down
description:Shutdown System
Save the file to "/usr/local/opnsense/service/conf/actions.d" folder.
Now go to the console and issue the following command
# service configd restart
Now you can create your cron event. Should look like this:
(https://preview.ibb.co/hNptv9/Capture.png) (https://ibb.co/eX4hoU)
Obviously change the time to suit. :)
sorry for the late reply.. thanks a lot. it works and am really happy now