aboutsummaryrefslogtreecommitdiffstats
path: root/xenscreen.c
diff options
context:
space:
mode:
authorkraxel <kraxel>2006-07-04 12:50:18 +0000
committerkraxel <kraxel>2006-07-04 12:50:18 +0000
commite3d45811bb44ecc7f3d77f8865e73e65a421c6e3 (patch)
tree043e90c95b525a689d1be38f4d16965ab01d61f0 /xenscreen.c
parentc1cb096a8136c0acb2f8a80f53d2a6ef2bf771bf (diff)
downloadxenwatch-e3d45811bb44ecc7f3d77f8865e73e65a421c6e3.tar.gz
optionally start a shell
Diffstat (limited to 'xenscreen.c')
-rw-r--r--xenscreen.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/xenscreen.c b/xenscreen.c
index 94d4961..acda01b 100644
--- a/xenscreen.c
+++ b/xenscreen.c
@@ -35,6 +35,7 @@ static char *screen_title = "mon";
static char *screen_window = NULL;
static int screen_detached;
static int screen_logging;
+static int screen_shell;
static char builtin_screen_rc[] =
"multiuser on\n"
@@ -218,6 +219,8 @@ static void usage(FILE *fp)
"options:\n"
" -h print this text\n"
" -b print default screen config file\n"
+ " -z open a screen window with a shell\n"
+ "\n"
" -L enable console output logging\n"
" -c screenrc screen config file [%s]\n"
" -S session screen session name [%s]\n"
@@ -243,18 +246,17 @@ int main(int argc, char *argv[])
char **nav;
for (;;) {
- if (-1 == (c = getopt(argc, argv, "hdbLc:S:u:p:")))
+ if (-1 == (c = getopt(argc, argv, "hdbLzc:S:u:p:")))
break;
switch (c) {
+
+ /* screen-like behaviour */
case 'c':
screen_rc = optarg;
break;
case 'S':
screen_session = optarg;
break;
- case 'u':
- screen_unlink = optarg;
- break;
case 'p':
screen_window = optarg;
break;
@@ -264,6 +266,14 @@ int main(int argc, char *argv[])
case 'd':
screen_detached = 1;
break;
+
+ /* other options */
+ case 'u':
+ screen_unlink = optarg;
+ break;
+ case 'z':
+ screen_shell = 1;
+ break;
case 'b':
printf("%s", builtin_screen_rc);
exit(0);
@@ -343,6 +353,8 @@ int main(int argc, char *argv[])
"### This is the monitor process.\n"
"###\n"
"\n");
+ if (screen_shell)
+ screen_command("screen", "-t", "shell", "/bin/sh", NULL);
/* connect to xenstore */
xenstore = xenstore_open(1,1,1,1);