--- freem/src/fmadm.c 2025/04/02 19:59:38 1.28
+++ freem/src/fmadm.c 2025/04/03 01:41:02 1.29
@@ -1,5 +1,5 @@
/*
- * $Id: fmadm.c,v 1.28 2025/04/02 19:59:38 snw Exp $
+ * $Id: fmadm.c,v 1.29 2025/04/03 01:41:02 snw Exp $
* FreeM Administration Tool
*
*
@@ -24,6 +24,9 @@
* along with FreeM. If not, see .
*
* $Log: fmadm.c,v $
+ * Revision 1.29 2025/04/03 01:41:02 snw
+ * New features frozen; prepare 0.63.0-rc1
+ *
* Revision 1.28 2025/04/02 19:59:38 snw
* Automatically modify env.conf from fmadm reconfigure
*
@@ -174,6 +177,7 @@ extern char config_file[4096];
extern char env_config_file[4096];
extern char env_user[255];
extern char env_group[255];
+extern char env_enabled[10];
int fm_shell(void);
void fm_checkperms(void);
@@ -204,6 +208,7 @@ int main (int argc, char **argv)
short got_action = FALSE;
short got_object = FALSE;
+ strcpy (env_enabled, "true");
/* snprintf (config_file, 4096, "%s/freem.conf", SYSCONFDIR); */
@@ -290,6 +295,31 @@ int main (int argc, char **argv)
base_arg++;
break;
+
+ case 'E':
+ if (argv[i][2] != '=') {
+ fprintf (stderr, "fmadm: missing equals sign in flag -%c\n", argv[i][1]);
+ fmadm_usage ();
+ exit (1);
+ }
+
+ k = 0;
+
+ for (j = 3; j < strlen (argv[i]); j++) {
+ env_enabled[k++] = argv[i][j];
+ }
+ env_enabled[k] = '\0';
+
+ if ((strcmp (env_enabled, "true") != 0) && (strcmp (env_enabled, "false") != 0)) {
+ fprintf (stderr, "fmadm: -E (environment enabled) option must be either 'true' or 'false'\n");
+ fmadm_usage ();
+ exit (1);
+ }
+
+ base_arg++;
+
+ break;
+
case 'n':
if (argv[i][2] != '=') {
@@ -885,15 +915,14 @@ void fmadm_exit (int retval)
int fmadm_usage (void)
{
- fprintf (stdout, "\nusage: fmadm