openvpnctrl: Create firewall rules properly if roadwarrior server is disabled.

This commit is contained in:
Michael Tremer
2011-06-29 19:51:24 +02:00
parent 2bcff894ac
commit 858d8d9092

View File

@@ -268,10 +268,6 @@ void createChain(char *chain) {
}
void createAllChains(void) {
if (!((strcmp(enablered, "on")==0) || (strcmp(enableblue, "on")==0) || (strcmp(enableorange, "on")==0))){
fprintf(stderr, "OpenVPN is not enabled on any interface\n");
exit(1);
} else {
// create chain and chain references
if (!strcmp(enableorange, "on")) {
if (strlen(orangeif)) {
@@ -303,19 +299,12 @@ void createAllChains(void) {
}
}
}
}
void setFirewallRules(void) {
char protocol[STRING_SIZE] = "";
char dport[STRING_SIZE] = "";
char dovpnip[STRING_SIZE] = "";
/* check if it makes sence to proceed further */
if (!((strcmp(enablered, "on")==0) || (strcmp(enableblue, "on")==0) || (strcmp(enableorange, "on")==0))){
fprintf(stderr, "Config error, at least one device must be enabled\n");
exit(1);
}
kv = initkeyvalues();
if (!readkeyvalues(kv, CONFIG_ROOT "/ovpn/settings"))
{