开发者

Execute specific command from plasmoid

开发者 https://www.devze.com 2023-01-28 15:14 出处:网络
I\'m writing a Remote Control Plasmoid, I want it to send certain commands over ssh to a remote host, I\'ve tried:

I'm writing a Remote Control Plasmoid, I want it to send certain commands over ssh to a remote host, I've tried:

QProcess p;
p.start("/home/user/bin/command");
p.waitfForFinished(-1);

where command is a script which has

#!/bin/bash
ssh user@remote_host remote_command &> /dev/null &

I've also tried using

KRun::ru开发者_运维技巧n(QString("/home/user/bin/command"), NULL);

but it does nothing, perhaps I'm using it the wrong way? Any suggestions?


OK, my problem was that I didn't connect the signals correctly, now I've done that and this part of code works perfectly.

best regards!

0

精彩评论

暂无评论...
验证码 换一张
取 消