]>
git.ipfire.org Git - ipfire-2.x.git/blob - src/install+setup/install/net.c
296b0fe956c76eac953c449f657b9991128258f9
1 /* SmoothWall install program.
3 * This program is distributed under the terms of the GNU General Public
4 * Licence. See the file COPYING for details.
6 * (c) Lawrence Manning, 2001
7 * Stuff for downloading the smoothwall tarball using wget.
9 * $Id: net.c,v 1.8.2.2 2004/04/14 22:05:40 gespinasse Exp $
20 static int got_url
= 0;
22 char url
[STRING_SIZE
];
24 static int gettarballurl();
26 int checktarball(char *file
)
30 char commandstring
[STRING_SIZE
];
35 if (!got_url
&& gettarballurl() != 1)
38 /* remove any successive /'s */
39 while (url
[strlen(url
)-1] == '/') { url
[strlen(url
)-1] = '\0'; }
41 snprintf(commandstring
, STRING_SIZE
, "/bin/wget -s -O /dev/null %s/%s", url
, file
);
42 if (!(runcommandwithstatus(commandstring
, ctr
[TR_CHECKING
])))
49 errorbox(ctr
[TR_FAILED_TO_FIND
]);
60 static int gettarballurl()
62 char *values
[] = { NULL
, NULL
}; /* pointers for the values. */
63 struct newtWinEntry entries
[] =
64 { { "", &values
[0], 0,}, { NULL
, NULL
, 0 } };
65 char title
[STRING_SIZE
];
69 sprintf(message
, ctr
[TR_ENTER_URL
]);
70 sprintf (title
, "%s v%s - %s", NAME
, VERSION
, SLOGAN
);
71 rc
= newtWinEntries(title
, message
,
72 60, 5, 5, 50, entries
, ctr
[TR_OK
], ctr
[TR_CANCEL
], NULL
);
74 strncpy(url
, values
[0], STRING_SIZE
);