From 32028c69bfb827df00dba018de782d68bdc5e080 Mon Sep 17 00:00:00 2001 From: Markus Katharina Brechtel Date: Sat, 8 Jan 2022 20:57:14 +0100 Subject: [PATCH] barrier ssh connection --- tasks/barrier.yaml | 6 ++++++ .../barrier/barrier-ssh-connection@.service.j2 | 16 ++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 templates/barrier/barrier-ssh-connection@.service.j2 diff --git a/tasks/barrier.yaml b/tasks/barrier.yaml index 949bcb3..89e48dd 100644 --- a/tasks/barrier.yaml +++ b/tasks/barrier.yaml @@ -62,3 +62,9 @@ src: barrier/barrierc@.service.j2 dest: ~/.config/systemd/user/barrierc@.service notify: systemd daemon-reload + +- name: barrier ssh conection user service + template: + src: barrier/barrier-ssh-connection@.service.j2 + dest: ~/.config/systemd/user/barrier-ssh-connection@.service + notify: systemd daemon-reload diff --git a/templates/barrier/barrier-ssh-connection@.service.j2 b/templates/barrier/barrier-ssh-connection@.service.j2 new file mode 100644 index 0000000..e6adb2f --- /dev/null +++ b/templates/barrier/barrier-ssh-connection@.service.j2 @@ -0,0 +1,16 @@ +{{ ansible_managed | comment }} + +[Unit] +Description=barrier ssh connection +PartOf=graphical-session.target + +[Service] +Type=simple +ExecStart=sh -c "sleep infinity | ssh $@" ssh -R 24800:localhost:24800 %i\ +systemctl --user stop lockscreen.service;\ +systemctl --user start barrierc@localhost.service;\ +systemd-run --user -u lockscreen-barrier-unlock sh -c "\"cat < lock > /dev/null; systemctl --user start lockscreen.service; systemctl --user stop barrierc@localhost.service;\"";\ +exec > lock + +[Install] +WantedBy=graphical-session.target