Skip to content

Instantly share code, notes, and snippets.

Last active February 21, 2022 23:04
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
# Kill all pts sessions that are not you and leave a message for all theses.
# Version 0.1
# Author: Igor A.
# usage: $ killpts [TICKET]
# usage 2: $ killpts
# example: $ killpts 2565489
var1=$(who am i | awk '{print $2}')
var2=$(who | awk '{print $2}' |egrep -v $var1)
for i in `echo $var2`
echo "Another Analyst are working on this server, please talk with $EMPNAME on private or on Ticket $ticket" > /dev/$i
fuser -k /dev/$i
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment