This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# 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 | |
# | |
ticket=$1 | |
var1=$(who am i | awk '{print $2}') | |
var2=$(who | awk '{print $2}' |egrep -v $var1) | |
EMPNAME="IgorA" | |
for i in `echo $var2` | |
do | |
echo "Another Analyst are working on this server, please talk with $EMPNAME on private or on Ticket $ticket" > /dev/$i | |
fuser -k /dev/$i | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment