标签:end class send mys monitor bash 提示 调用 nbsp
通过对last
信息的处理和保存、使用notify-send
命令调用弹窗提示等手段实现ssh
登录和退出登录的提示。
信息处理利用了head
、awk
和cut
命令。
使用:
在.bashrc
(如果您的shell是bash)中执行该脚本,加上login
参数即可:bash [脚本保存路径]/log_monitor.sh login
在.bash_logout
(如果您的shell是bash)中执行该脚本,加上logout
参数即可:bash [脚本保存路径]/log_monitor.sh logout
注意:不同的shell
请参考man
手册查找相应的登录执行文件和退出登录执行文件。
标签:end class send mys monitor bash 提示 调用 nbsp
原文地址:https://www.cnblogs.com/sunowsir/p/9691479.html