Fix a few silly errors
This commit is contained in:
parent
f19e850e0d
commit
c7e3e56bd2
|
@ -52,6 +52,7 @@ export class Session {
|
||||||
util.privilegedExec(this.context, bash(cmdline));
|
util.privilegedExec(this.context, bash(cmdline));
|
||||||
privilegedPty = (cmdline) =>
|
privilegedPty = (cmdline) =>
|
||||||
util.privilegedPty(this.context, bash(cmdline, { stty: true }));
|
util.privilegedPty(this.context, bash(cmdline, { stty: true }));
|
||||||
|
privilegedTeardown = (cmdline) => util.privilegedTeardown(this.context);
|
||||||
|
|
||||||
setup = async () => {
|
setup = async () => {
|
||||||
try {
|
try {
|
||||||
|
@ -449,7 +450,7 @@ export class Session {
|
||||||
if (this.container) {
|
if (this.container) {
|
||||||
this.container.proc.kill();
|
this.container.proc.kill();
|
||||||
}
|
}
|
||||||
await this.run(this.privilegedTeardown({ uuid }));
|
await this.run(this.privilegedTeardown());
|
||||||
allSessions.delete(this);
|
allSessions.delete(this);
|
||||||
this.ws.terminate();
|
this.ws.terminate();
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|
|
@ -418,10 +418,12 @@ void teardown(char *uuid)
|
||||||
if (asprintf(&cmdline, "rm -rf /var/cache/riju/shares/%s", uuid) < 0)
|
if (asprintf(&cmdline, "rm -rf /var/cache/riju/shares/%s", uuid) < 0)
|
||||||
die("asprintf failed");
|
die("asprintf failed");
|
||||||
} else {
|
} else {
|
||||||
cmdline = "comm -23 <(sudo ls /var/cache/riju/shares | sort) <(docker ps "
|
cmdline =
|
||||||
"-f label=riju.category=user-session --format \"{{ .Labels }}\" "
|
"comm -23 <(sudo ls /var/cache/riju/shares | sort) <(docker ps "
|
||||||
"| grep -Eo 'riju\\.user-session=[a-z0-9]+' | sed -E "
|
"-f label=riju.category=user-session --format \"{{ .Labels }}\" "
|
||||||
"'s/^[^=]+=//') | (cd /var/cache/riju/shares; xargs rm -rf)";
|
"| grep -Eo 'riju\\.user-session=[a-z0-9]+' | sed -E "
|
||||||
|
"'s/^[^=]+=//' | sort) | (cd /var/cache/riju/shares 2>/dev/null && "
|
||||||
|
"xargs rm -rf || :)";
|
||||||
}
|
}
|
||||||
char *argv[] = {"bash", "-c", cmdline, NULL};
|
char *argv[] = {"bash", "-c", cmdline, NULL};
|
||||||
execvp(argv[0], argv);
|
execvp(argv[0], argv);
|
||||||
|
|
Loading…
Reference in New Issue