From c542dee1b3e5f9ff9524f4c425d49cacb013b2a5 Mon Sep 17 00:00:00 2001 From: Gardouille Date: Tue, 23 Sep 2014 01:11:00 +0200 Subject: [PATCH] =?UTF-8?q?S=C3=A9curise=20un=20peu=20plus=20la=20mise=20e?= =?UTF-8?q?n=20veille.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- veille.sh | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/veille.sh b/veille.sh index fd54bd3..86b8e82 100755 --- a/veille.sh +++ b/veille.sh @@ -1,11 +1,24 @@ -#!/bin/bash +#!/bin/sh -### Petit script qui: -## supprime les agents ssh qui tourent -## met en veille la machine +# Description: Kill all ssh connections +# Delete all ssh agents +# Ensure to kill all ssh-agent +# Ensure to kill all gpg-agent +# Lock the screen +### Give an easy way to call this function with a keybind. +## For example with herbstluftwm: "hc keybind $Mod-Shift-c spawn ~/bin/veille.sh" -### Le but étant de simplifier l'appel à ces fonctionnalités depuis un keybind -## Sous herbstluftwm par exemple: "hc keybind $Mod-Shift-c spawn ~/bin/veille.sh" +## depend: i3lock -keychain --clear && rm -rf ~/.keychain/* +# SSH Connections +killall ssh +rm -rf ~/.ssh/socks/* +# SSH Agent +killall ssh-agent +rm -rf /tmp/ssh-* +# GPG Agent +killall gpg-agent +# Delete everything link to ssh-agent or gpg-agent +rm -rf ~/.keychain/* +# Lock the screen i3lock -c 000000 --pointer win -d