Kano001 commited on
Commit
8dd736d
1 Parent(s): c533563

Update server.js

Browse files
Files changed (1) hide show
  1. server.js +2 -5
server.js CHANGED
@@ -16,12 +16,9 @@ wss.on('connection', (ws) => {
16
  console.log(`Received message: ${message}`);
17
 
18
  // Convert message (Buffer) to string
19
- let command = message.toString();
20
 
21
- // Prefix command with 'sudo'
22
- command = `sudo ${command}`;
23
-
24
- // Execute the command with superuser privileges
25
  exec(command, (error, stdout, stderr) => {
26
  if (error) {
27
  ws.send(`Error: ${error.message}`);
 
16
  console.log(`Received message: ${message}`);
17
 
18
  // Convert message (Buffer) to string
19
+ const command = message.toString();
20
 
21
+ // Execute the command without sudo
 
 
 
22
  exec(command, (error, stdout, stderr) => {
23
  if (error) {
24
  ws.send(`Error: ${error.message}`);