Skip to content

Commit

Permalink
implemented AGS restart (not tested)
Browse files Browse the repository at this point in the history
  • Loading branch information
ZachLTech committed Jul 14, 2024
1 parent 66e2167 commit 120fb43
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/backend/src/backend.js
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,11 @@ class AEVBackend {
this.logger.fail('There was an error restarting the VPN: ' + error);
console.log(error);
}
} else if (message === 'lap-start') {
} else if (message === 'ags-restart') {
execSync(`killall ags && ags &`);
this.logger.success(`Successfully Restarted AGS Bar`);
}
else if (message === 'lap-start') {
this.laps.start();
reply = 'Lap started';
this.logger.success('Lap & stopwatch started');
Expand Down
6 changes: 6 additions & 0 deletions src/frontend/pages/debug.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ let socket;
function restartVPN(){
socket.send("vpn-restart");
}
function restartAGS(){
socket.send("ags-restart");
}
</script>

<template>
Expand All @@ -39,6 +42,9 @@ let socket;
<button @click="restartVPN" class="text-3xl font-semibold ml-2 px-4 py-2 bg-red-500 text-white rounded hover:bg-red-600 focus:outline-none">
Restart VPN
</button>
<button @click="restartAGS" class="text-3xl font-semibold ml-2 px-4 py-2 bg-red-500 text-white rounded hover:bg-red-600 focus:outline-none">
Restart AGS
</button>
</div>
<div class="flex gap-4 justify-center items-center w-full h-[90%] px-16">
<debugBox :timeInterval="600" :protocol="'bms-alerts'" />
Expand Down

0 comments on commit 120fb43

Please sign in to comment.