Führen Sie das Bash -Skript mit Sudo -Passwort aus

echo <password> | sudo -S <command>
Merwanski