mirror of
https://github.com/trimstray/the-book-of-secret-knowledge.git
synced 2024-10-01 01:26:00 -04:00
Merge pull request #40 from lbonanomi/last
find panic reboots with /usr/bin/last
This commit is contained in:
commit
06c8eb3879
11
README.md
11
README.md
@ -744,6 +744,7 @@ Linux Security Expert</b></a> - trainings, howtos, checklists, security tools an
|
|||||||
* [tr](#tool-tr)
|
* [tr](#tool-tr)
|
||||||
* [chmod](#tool-chmod)
|
* [chmod](#tool-chmod)
|
||||||
* [who](#tool-who)
|
* [who](#tool-who)
|
||||||
|
* [last](#tool-last)
|
||||||
* [screen](#tool-screen)
|
* [screen](#tool-screen)
|
||||||
* [du](#tool-du)
|
* [du](#tool-du)
|
||||||
* [inotifywait](#tool-inotifywait)
|
* [inotifywait](#tool-inotifywait)
|
||||||
@ -1246,6 +1247,16 @@ who -b
|
|||||||
|
|
||||||
___
|
___
|
||||||
|
|
||||||
|
##### Tool: [last]
|
||||||
|
|
||||||
|
###### Was the last reboot a panic?
|
||||||
|
|
||||||
|
```bash
|
||||||
|
(last -x -f $(ls -1t /var/log/wtmp* | head -2 | tail -1); last -x -f /var/log/wtmp) | grep -A1 reboot | head -2 | grep -q shutdown && echo "Expected reboot" || echo "Panic reboot"
|
||||||
|
```
|
||||||
|
|
||||||
|
___
|
||||||
|
|
||||||
##### Tool: [screen](https://en.wikipedia.org/wiki/GNU_Screen)
|
##### Tool: [screen](https://en.wikipedia.org/wiki/GNU_Screen)
|
||||||
|
|
||||||
###### Start screen in detached mode
|
###### Start screen in detached mode
|
||||||
|
Loading…
Reference in New Issue
Block a user