美文网首页工具箱
Ubuntu使用ssh远程打开terminal执行脚本

Ubuntu使用ssh远程打开terminal执行脚本

作者: 像鸣人 | 来源:发表于2019-12-25 20:43 被阅读0次

gui-launcher

#!/bin/bash -e
# NAME: gui-launcher
# Check whether the user is logged-in
while [ -z "$(pgrep gnome-session -n -U $UID)" ]; do sleep 3; done
# Export the current desktop session environment variables
export $(xargs -0 -a "/proc/$(pgrep gnome-session -n -U $UID)/environ")
# Execute the input command
#nohup "$@" >/dev/null 2>&1 &
source "$@"
exit 0

remote_start.sh

terminator -x  bash -c "/home/u1/startup.sh"

ssh命令

ssh u1@192.168.1.x "/home/u1/gui-launcher remote_start.sh"

相关文章

网友评论

    本文标题:Ubuntu使用ssh远程打开terminal执行脚本

    本文链接:https://www.haomeiwen.com/subject/ierhoctx.html