ukanth / afwall

AFWall+ (Android Firewall +) - iptables based firewall for Android
GNU General Public License v3.0
2.79k stars 456 forks source link

Custom script: "Can't execute: Permission denied" #950

Open Perflyst opened 5 years ago

Perflyst commented 5 years ago

I tried to add a custom script, but I always get permission denied. Tested with location ./storage/emulated/0/afwall/script.sh and ./data/local/script.sh. I wonder if there is a chmod +x needed. If yes, how do I set it? Doesnt work via adb nor via termux on the device itself.

helpshands commented 5 years ago

Maybe you have to edit the path. For me it helped to insert a "space" between "." and "/" at the beginning. . /storage/emulated/0/afwall/script.sh instead of ./storage/emulated/0/afwall/script.sh

h1z1 commented 4 years ago

This should be in the readme because it's not obvious, I've hit it more times then I care to admit. The issue is most if not all mounts are set noexec so you can't run the script directly (chmod +x will not help). Thus ". /foo" - sourcing it rather then directly executing. It also means your script will inherit whatever environment is setup.