Closed felinto-dev closed 3 years ago
Hi, you can debug this shell issue by adding an additional route to print your PATH, like this
shell2http -export-all-vars -shell=bash -form /test 'echo $PATH'
and you can check if the directory with your utility is included in the PATH
Also using double quotes will not work when using variables ($v_ip) because your shell expands variable before run shell2http, you should use single quotes: /unblock-ip 'csf -g $v_ip'
Thanks! I can see that the "csf" utility is in the PATH environment variable:
[root@acesso public_html]# echo $SHELL
/bin/bash
[root@acesso public_html]# which csf
/usr/sbin/csf
[root@acesso public_html]# shell2http -export-all-vars -shell=bash -form /test 'echo $PATH'
2021/03/17 17:17:50 register: /test (echo $PATH)
2021/03/17 17:17:50 register: / (index page)
2021/03/17 17:17:50 listen http://localhost:8080/
I receive the result in my browser: /snap/shell2http/120/usr/sbin:/snap/shell2http/120/usr/bin:/snap/shell2http/120/sbin:/snap/shell2http/120/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
"/usr/sbin" is in list.
[root@acesso public_html]# shell2http -export-all-vars -shell="bash" -form /unblock-ip 'csf -g $v_ip'
2021/03/17 17:19:40 register: /unblock-ip (csf -g $v_ip)
2021/03/17 17:19:40 register: / (index page)
2021/03/17 17:19:40 listen http://localhost:8080/
I still receive the same error using single quotes.
/snap/...
do you use snap installation of shell2http?
The snap-package has its own sandbox with the /bin, /usr/bin directories which are not equal to system-wide PATH directories. Please use another type of installation, for example deb-package from release page.
Thanks! I install the binary and now works!
When I run this command I get this error message:
I can affirm that this command exists.