Changes

342 bytes added ,  14:23, 24 August 2018
Line 148: Line 148:     
Let's overview what each segment indicates sequentially:
 
Let's overview what each segment indicates sequentially:
* 0/0 - the actions for both rules must take place at minute 0 (right after the hour has changed)
+
* '''First line'''
* 8/18 - the actions must take place at 8 AM and 6 PM respectively
+
** 0 - the action must take place at minute 0 (right after the hour has changed)
* */* - all days of the month are applicable to the rules
+
** 8 - the action must take place at 8 AM
* */* - all months of the year are applicable to the rules
+
** * - all days of the month are applicable to the rule
* 1-5 - the actions for both rules must take place every Monday - Friday
+
** * - all months of the year are applicable to the rule
* openvpn.7365727665725F64656D6F.enable='''1/0''' - enables/disables OpenVPN (note that the first rule has ''enable=1'' in it and the second one has ''enable=0''; 1 equals ON; 0 equals OFF)
+
** 1-5 - the action must take place every Monday - Friday
* uci commit - commits configuration changes
+
** uci set openvpn.7365727665725F64656D6F.enable=1 - enables the OpenVPN instance
* /etc/init.d/openvpn restart - restarts the OpenVPN service
+
** uci commit - commits configuration changes
* && - symbols used to separate different commands
+
** /etc/init.d/openvpn restart - restarts the OpenVPN service
 +
* '''Second line'''
 +
** 0 - the action must take place at minute 0 (right after the hour has changed)
 +
** 18 - the action must take place at 6 PM
 +
** * - all days of the month are applicable to the rule
 +
** * - all months of the year are applicable to the rule
 +
** 1-5 - the action must take place every Monday - Friday
 +
** uci set openvpn.7365727665725F64656D6F.enable=0 - enables the OpenVPN instance
 +
** uci commit - commits configuration changes
 +
** /etc/init.d/openvpn restart - restarts the OpenVPN service
 +
* && - separates different commands
    
To sum up, the first line enables the OpenVPN server at 8 AM, the second disables it at 6 PM. At the end of the enabling and disabling processes the changes are committed and the related services restarted. We used UCI to change the state of the OpenVPN server. You can find more information on UCI in this article: '''[[UCI command usage]]'''.
 
To sum up, the first line enables the OpenVPN server at 8 AM, the second disables it at 6 PM. At the end of the enabling and disabling processes the changes are committed and the related services restarted. We used UCI to change the state of the OpenVPN server. You can find more information on UCI in this article: '''[[UCI command usage]]'''.

Navigation menu