Reputation: 63
So the original command i wanted to pass is -
runuser -l chrome -c 'DISPLAY= /opt/google/chrome-remote-desktop/start-host --code="4/yourcode" --redirect-url="https://remotedesktop.google.com/_/oauthredirect" --name=VastInstance'
And i tried two ways. First one is-
def pcall(pram):
s.run([pram], shell=True)
pcall("runuser -l raiyan -c 'DISPLAY= /opt/google/chrome-remote-desktop/start-host --code=\"4/0AY0e-g6DezhppO-9eF6BCGahZOOxN-Rs2uG0lm-G0FRIL1PvLR22-oqnCBHGmVUjr86o2A\" --redirect-url=\"https://remotedesktop.google.com/_/oauthredirect\" --name=Raiyan\'s PC' --pin=000000") ```
where pcall is a function that calls subprocess.run() and the error says ```/bin/sh: 1: Syntext error: Unterminated quoted string.```
So i tried another way - ```s.run({'runuser','-l,'raiyan','-c','DISPLAY=','/opt/google/chrome-remote-desktop/start-host','--code=','4/SomeCode','--redirect-url=','https://remotedesktop.google.com/\_/oauthredirect','--name=','raiyan'])```
And this also show Syntex error right here
>https:// remotedesktop.google .com/\➡️_/⬅️oauthredirect
I'm absolutely clueless about what to do here. [And i also don't understand why the code tag is not working here :( ]
Upvotes: 0
Views: 203
Reputation: 128
You could try using triple quotes so you don't have to escape any in the command.
pcall("""runuser -l chrome -c 'DISPLAY= /opt/google/chrome-remote-desktop/start-host --code="4/yourcode" --redirect-url="https://remotedesktop.google.com/_/oauthredirect" --name=VastInstance'""")
Upvotes: 2