]>
Commit | Line | Data |
---|---|---|
ac3e350b MT |
1 | From bdb25774a216925fd1ca275a6e2b3ccc8e9a0200 Mon Sep 17 00:00:00 2001 |
2 | From: Reinier Haasjes <reinier@haasjes.com> | |
3 | Date: Fri, 17 Aug 2012 11:29:39 +0200 | |
4 | Subject: [PATCH 01/10] setup script | |
5 | ||
6 | Make setupscript work and add teardownscript setting. | |
7 | ||
8 | Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org> | |
9 | --- | |
10 | common/aiccu.c | 6 +++--- | |
11 | unix-console/main.c | 5 +++++ | |
12 | 2 files changed, 8 insertions(+), 3 deletions(-) | |
13 | ||
14 | diff --git a/common/aiccu.c b/common/aiccu.c | |
15 | index 9abb334..7697136 100755 | |
16 | --- a/common/aiccu.c | |
17 | +++ b/common/aiccu.c | |
18 | @@ -212,9 +212,6 @@ bool aiccu_SaveConfig(const char *filename) | |
19 | fprintf(f, "# Try to automatically login and setup the tunnel?\n"); | |
20 | fprintf(f, "automatic %s\n", g_aiccu->automatic ? "true" : "false"); | |
21 | fprintf(f, "\n"); | |
22 | - fprintf(f, "# Script to run after setting up the interfaces (default: none)\n"); | |
23 | - fprintf(f, "%ssetupscript %s\n", g_aiccu->setupscript ? "" : "#", g_aiccu->setupscript ? g_aiccu->setupscript : "<path>"); | |
24 | - fprintf(f, "\n"); | |
25 | fprintf(f, "# TLS Required?\n"); | |
26 | fprintf(f, "requiretls %s\n", g_aiccu->requiretls ? "true" : "false"); | |
27 | fprintf(f, "\n"); | |
28 | @@ -231,6 +228,9 @@ bool aiccu_SaveConfig(const char *filename) | |
29 | fprintf(f, "# PID File\n"); | |
30 | fprintf(f, "pidfile %s\n", g_aiccu->pidfile); | |
31 | fprintf(f, "\n"); | |
32 | + fprintf(f, "# Script to run after setting up the interfaces (default: none)\n"); | |
33 | + fprintf(f, "%ssetupscript %s\n", g_aiccu->setupscript ? "" : "#", g_aiccu->setupscript ? g_aiccu->setupscript : "<path>"); | |
34 | + fprintf(f, "\n"); | |
35 | fprintf(f, "# Make heartbeats (default true)\n"); | |
36 | fprintf(f, "# In general you don't want to turn this off\n"); | |
37 | fprintf(f, "# Of course only applies to AYIYA and heartbeat tunnels not to static ones\n"); | |
38 | diff --git a/unix-console/main.c b/unix-console/main.c | |
39 | index 8a4d9a9..1e7b4b4 100755 | |
40 | --- a/unix-console/main.c | |
41 | +++ b/unix-console/main.c | |
42 | @@ -471,6 +471,11 @@ int main(int argc, char *argv[]) | |
43 | */ | |
44 | if (aiccu_setup(hTunnel, true)) | |
45 | { | |
46 | + if (g_aiccu->setupscript) | |
47 | + { | |
48 | + aiccu_exec("%s", g_aiccu->setupscript); | |
49 | + } | |
50 | + | |
51 | /* We need to stay running when doing Heartbeat or AYIYA */ | |
52 | if ( strcasecmp(hTunnel->sType, "6in4-heartbeat") == 0 || | |
53 | strcasecmp(hTunnel->sType, "ayiya") == 0) | |
54 | -- | |
55 | 1.8.1 | |
56 |