char *initfile = "/etc/init.d/citadel";
char command[SIZ];
- if (yesno("Would you like to automatically start Citadel at boot?\n", 1) == 0) {
- return;
- }
-
if ((stat("/etc/init.d/", &etcinitd) == -1) &&
(errno == ENOENT))
{
initfile = "/etc/rc.d/init.d/citadel";
}
+ fp = fopen(initfile, "r");
+ if (fp != NULL) {
+ if (yesno("Citadel already appears to be configured to start at boot.\n"
+ "Would you like to keep your boot configuration as is?\n", 1) == 1) {
+ return;
+ }
+ fclose(fp);
+
+ }
+
+ if (yesno("Would you like to automatically start Citadel at boot?\n", 1) == 0) {
+ return;
+ }
+
fp = fopen(initfile, "w");
if (fp == NULL) {
display_error("Cannot create /etc/init.d/citadel");
FILE *fp;
char *initfile = "/etc/init.d/webcit";
+ fp = fopen(initfile, "r");
+ if (fp != NULL) {
+ if (yesno("WebCit already appears to be configured to start at boot.\n"
+ "Would you like to keep your boot configuration as is?\n", 1) == 1) {
+ return;
+ }
+ fclose(fp);
+
+ }
+
/* Otherwise, prompt the user to create an entry. */
snprintf(question, sizeof question,
"Would you like to automatically start WebCit at boot?"