Created
March 15, 2015 01:45
-
-
Save cabrinha/abc31ab970412d1e6608 to your computer and use it in GitHub Desktop.
Check if a user is logged in and log them out.
This file contains hidden or 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
#!/usr/bin/env bash | |
set -e | |
username=$1 | |
w | awk '{print $1}' | grep $username | |
if [[ $? == 0 ]]; | |
then kill -HUP $PPID; | |
fi | |
exit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment