I have two scripts that needs to be executed in chain. (First script calls the second script). The problem is that the first script needs sudo to function as expected, and the second script needs to be executed without sudo.
I've found and tried a few methods in my investigations but nothing worked. Following are the ways I tried:
$ sudo -Hu <currentUser> ./myscript.py
$ dbus-launch ./myscript.py
$ sudo -Hu <currentUser> dbus-launch ./myscript.py
Any other way to get around this issue? and I have no idea why the dbus-launch is not working here, many sites suggested that it should work fine.
I'm using Ubuntu 18.04.