]>
git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - src/install+setup/install/net.c
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.
18 static int got_url
= 0;
20 char url
[STRING_SIZE
] = "http://";;
22 static int gettarballurl(char *url
, char *message
);
24 int checktarball(char *file
, char *message
)
28 char commandstring
[STRING_SIZE
];
33 if (!got_url
&& gettarballurl(url
, message
) != 1)
36 /* remove any successive /'s */
37 while (url
[strlen(url
)-1] == '/') { url
[strlen(url
)-1] = '\0'; }
39 snprintf(commandstring
, STRING_SIZE
, "/bin/wget -s -O /dev/null %s/%s", url
, file
);
40 if (!(runcommandwithstatus(commandstring
, ctr
[TR_CHECKING
])))
47 errorbox(ctr
[TR_FAILED_TO_FIND
]);
50 return 1; /* failure */
58 static int gettarballurl(char *url
, char *message
)
60 char *values
[] = { url
, NULL
}; /* pointers for the values. */
61 struct newtWinEntry entries
[] =
62 { { "", &values
[0], 0,}, { NULL
, NULL
, 0 } };
63 char title
[STRING_SIZE
];
66 sprintf (title
, "%s v%s - %s", NAME
, VERSION
, SLOGAN
);
67 rc
= newtWinEntries(title
, message
,
68 60, 5, 5, 50, entries
, ctr
[TR_OK
], ctr
[TR_CANCEL
], NULL
);
70 strncpy(url
, values
[0], STRING_SIZE
);