]>
Commit | Line | Data |
---|---|---|
3ed092f9 JR |
1 | Author: Norman Rasmussen <norman@rasmussen.co.za> |
2 | ||
3 | Make setupscript work and add teardownscript setting. | |
4 | ||
5 | --- aiccu.orig/common/aiccu.c | |
6 | +++ aiccu/common/aiccu.c | |
7 | @@ -212,9 +212,6 @@ | |
8 | fprintf(f, "# Try to automatically login and setup the tunnel?\n"); | |
9 | fprintf(f, "automatic %s\n", g_aiccu->automatic ? "true" : "false"); | |
10 | fprintf(f, "\n"); | |
11 | - fprintf(f, "# Script to run after setting up the interfaces (default: none)\n"); | |
12 | - fprintf(f, "%ssetupscript %s\n", g_aiccu->setupscript ? "" : "#", g_aiccu->setupscript ? g_aiccu->setupscript : "<path>"); | |
13 | - fprintf(f, "\n"); | |
14 | fprintf(f, "# TLS Required?\n"); | |
15 | fprintf(f, "requiretls %s\n", g_aiccu->requiretls ? "true" : "false"); | |
16 | fprintf(f, "\n"); | |
17 | @@ -231,6 +228,9 @@ | |
18 | fprintf(f, "# PID File\n"); | |
19 | fprintf(f, "pidfile %s\n", g_aiccu->pidfile); | |
20 | fprintf(f, "\n"); | |
21 | + fprintf(f, "# Script to run after setting up the interfaces (default: none)\n"); | |
22 | + fprintf(f, "%ssetupscript %s\n", g_aiccu->setupscript ? "" : "#", g_aiccu->setupscript ? g_aiccu->setupscript : "<path>"); | |
23 | + fprintf(f, "\n"); | |
24 | fprintf(f, "# Make heartbeats (default true)\n"); | |
25 | fprintf(f, "# In general you don't want to turn this off\n"); | |
26 | fprintf(f, "# Of course only applies to AYIYA and heartbeat tunnels not to static ones\n"); | |
27 | --- aiccu.orig/unix-console/main.c | |
28 | +++ aiccu/unix-console/main.c | |
29 | @@ -471,6 +471,11 @@ | |
30 | */ | |
31 | if (aiccu_setup(hTunnel, true)) | |
32 | { | |
33 | + if (g_aiccu->setupscript) | |
34 | + { | |
35 | + aiccu_exec("%s", g_aiccu->setupscript); | |
36 | + } | |
37 | + | |
38 | /* We need to stay running when doing Heartbeat or AYIYA */ | |
39 | if ( strcasecmp(hTunnel->sType, "6in4-heartbeat") == 0 || | |
40 | strcasecmp(hTunnel->sType, "ayiya") == 0) |