@Linus67 it needs to be ran as root. Sudo is interactive in terminal so it won't work, but pkexec is the GUI equivalent so it should launch a popup for the password. Alternatively set the suid bit of the script to make it always run as root without password (and ensure the file is not writable by phablet as that would allow local privilege escalation).