Skip to content

Commit 3b8271f

Browse files
fix: container restart
1 parent 9b848fb commit 3b8271f

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
3+
# This script takes in 1 command line argument (the container name)
4+
5+
id -u
6+
if [ "$#" -ne 1 ]; then
7+
echo "Usage: $0 container_name"
8+
exit 1
9+
fi
10+
11+
arg1=$1
12+
13+
echo "Restarting... $arg1"
14+
15+
sudo docker restart $arg1

src/backend/utils/auto-restart.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export function getRestartCount(containerName: string): number {
99
export async function restartContainer(containerName: string): Promise<void> {
1010
try {
1111
await exec(
12-
`bash -c "echo 'docker restart ${containerName}' > /hostpipe/pipe"`
12+
`bash -c "echo 'bash ../../src/backend/shell_scripts/restart.sh ${containerName}' > /hostpipe/pipe"`
1313
);
1414

1515
const current = restartCounts.get(containerName);

0 commit comments

Comments
 (0)