hulxv / vnstat-client

GUI Client for vnStat Network Monitor for Linux or GNU/Linux
https://hulxv.github.io/vnstat-client/
GNU General Public License v2.0
151 stars 10 forks source link

Redirection problem #37

Open Mahmoud-Ibrahim-750 opened 10 months ago

Mahmoud-Ibrahim-750 commented 10 months ago

Problem: Here is the error that pops up when I run the app:

***@***:~$ vnstat-client
20:40:26.790 › [PRODUCTION] vnStat Client is Running.
20:40:27.350 › Getting data...
20:40:27.351 › APPIMAGE env is not defined, current application is not an AppImage
20:40:27.457 › Error: Command failed:                                                                       
                    if grep -q "$(systemctl is-active vnstat)" <<< "active" ;
                        then echo "true"                                        
                    else echo "false"
                fi                                          

/bin/sh: 2: Syntax error: redirection unexpected

    at ChildProcess.exithandler (node:child_process:408:12)
    at ChildProcess.emit (node:events:526:28)
    at maybeClose (node:internal/child_process:1092:16)
    at Socket.<anonymous> (node:internal/child_process:451:11)
    at Socket.emit (node:events:526:28)
    at Pipe.<anonymous> (node:net:687:12)
20:40:27.461 › Getting data is successfully
20:40:29.980 › vnStat-client has been closed.

And the app is unable to read data from the database however vnstat works perfectly and shows data in the terminal.

Possible solution: After some research, it looks like that the script is using Dash instead of Bash (because I use Ubuntu) so it may solve the problem if Bash is used instead of using the default shell in the script. This may not be the best solution and you should consider other possible solutions if found.

hulxv commented 10 months ago

For now, I think you can try this command to run vnstat-client

$ bash -c "vnstat-client"

After college exams, I will try to work on your issue but I want more information about your system. I think the neofetch output will be enough.

Mahmoud-Ibrahim-750 commented 10 months ago

When I tried your suggestion, I got typically the same result I provided earlier. Anyway here's the neofetch you asked for, If you need more info, just tell me. neofetch output