Skip to content

Commit

Permalink
Make it possible to break out of showtime-shell by setting various en…
Browse files Browse the repository at this point in the history
…v variables
  • Loading branch information
andoma committed Jan 3, 2014
1 parent c7f3ad3 commit efffb1d
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion showtime-shell.c
Expand Up @@ -436,6 +436,8 @@ start_showtime_from_bundle(const char *bundle)
static int
runcmd(const char *cmdline)
{
trace(LOG_INFO, "Running '%s'", cmdline);

int ret = system(cmdline);

if(ret == -1) {
Expand Down Expand Up @@ -677,6 +679,9 @@ stop_by_pidfile(const char *pidfile)
int
main(int argc, char **argv)
{
if(atoi(getenv("STOS_noshowtime-shell") ?: ""))
return 0;

int c;
int prep = 0;
while((c = getopt(argc, argv, "r:p")) != -1) {
Expand All @@ -700,6 +705,10 @@ main(int argc, char **argv)
trace(LOG_INFO, "Persistent device on %s", persistent_part);
trace(LOG_INFO, " Cache device on %s", cache_part);

int noshowtime = !access("/boot/noshowtime", R_OK);

noshowtime |= atoi(getenv("STOS_noshowtime") ?: "");

if(prep) {

mkdir("/tmp/stos", 0777);
Expand All @@ -726,7 +735,7 @@ main(int argc, char **argv)
exit(0);
}

if(!access("/boot/noshowtime", R_OK)) {
if(noshowtime) {
start_sshd();
exit(0);
}
Expand Down

0 comments on commit efffb1d

Please sign in to comment.