mirror of
https://github.com/wireadmin/wireadmin
synced 2025-06-26 18:28:06 +00:00
fixes various bugs for Tor service
This commit is contained in:
@@ -2,8 +2,12 @@ import { json, type RequestHandler } from '@sveltejs/kit';
|
||||
import { execa } from 'execa';
|
||||
|
||||
export const GET: RequestHandler = async ({ params }) => {
|
||||
const { stdout } = await execa('screen', ['-ls'], { shell: true });
|
||||
const isRunning = stdout.includes(params.serviceName!);
|
||||
try {
|
||||
const { stdout } = await execa('screen', ['-ls'], { shell: true });
|
||||
const isRunning = stdout.includes(params.serviceName!);
|
||||
|
||||
return json({ healthy: isRunning });
|
||||
return json({ healthy: isRunning });
|
||||
} catch (e) {
|
||||
return json({ healthy: false });
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user