Skip to content

Instantly share code, notes, and snippets.

@shyazusa
Last active December 26, 2016 02:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shyazusa/8244d7cb905d7b2aad6b5c5a26975a10 to your computer and use it in GitHub Desktop.
Save shyazusa/8244d7cb905d7b2aad6b5c5a26975a10 to your computer and use it in GitHub Desktop.
SSHでログインしているかチェックするシェルスクリプト記述例
#!/bin/sh
set -eu
# Exit early if no sessions with my username are found
if ! who | grep -wq $USER; then
exit
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment