diff simtool/dispatch.c @ 123:b391204d3cd5

fc-simtool: add scripting facility in the form of exec command
author Mychaela Falconia <falcon@freecalypso.org>
date Thu, 28 Jan 2021 18:42:24 +0000
parents f18704e91393
children 6c4567dd8946
line wrap: on
line diff
--- a/simtool/dispatch.c	Thu Jan 28 05:12:10 2021 +0000
+++ b/simtool/dispatch.c	Thu Jan 28 18:42:24 2021 +0000
@@ -15,6 +15,7 @@
 extern int cmd_change_chv();
 extern int cmd_disable_chv();
 extern int cmd_enable_chv();
+extern int cmd_exec();
 extern int cmd_fix_sysmo_msisdn();
 extern int cmd_iccid();
 extern int cmd_imsi();
@@ -64,6 +65,7 @@
 	{"disable-pin", 1, 1, cmd_disable_chv},
 	{"enable-chv", 1, 1, cmd_enable_chv},
 	{"enable-pin", 1, 1, cmd_enable_chv},
+	{"exec", 1, 1, cmd_exec},
 	{"exit", 0, 0, cmd_exit},
 	{"fix-sysmo-msisdn", 0, 0, cmd_fix_sysmo_msisdn},
 	{"iccid", 0, 0, cmd_iccid},
@@ -101,7 +103,7 @@
 	{0, 0, 0, 0}
 };
 
-simtool_dispatch_cmd(cmd)
+simtool_dispatch_cmd(cmd, is_script)
 	char *cmd;
 {
 	char *argv[10];
@@ -112,6 +114,8 @@
 		;
 	if (!*cp || *cp == '#')
 		return(0);
+	if (is_script)
+		printf("Script command: %s\n", cp);
 	argv[0] = cp;
 	while (*cp && !isspace(*cp))
 		cp++;