[feature] script to prevent ssh waking up hd
This commit is contained in:
parent
42c67f85b5
commit
411a6b333b
21
bin/ubuntu-ssh-wakes-sleeping-hd.sh
Executable file
21
bin/ubuntu-ssh-wakes-sleeping-hd.sh
Executable file
|
@ -0,0 +1,21 @@
|
|||
#!/bin/sh
|
||||
|
||||
|
||||
# reference: https://askubuntu.com/questions/282245/ssh-login-wakes-spun-down-storage-drives
|
||||
|
||||
[ ! -f /usr/lib/update-notifier/update-motd-fsck-at-reboot.bak ] && \
|
||||
sudo cp /usr/lib/update-notifier/update-motd-fsck-at-reboot /usr/lib/update-notifier/update-motd-fsck-at-reboot.bak
|
||||
|
||||
|
||||
awk '
|
||||
$0 ~ /^now=/ {
|
||||
S=1
|
||||
}
|
||||
S==1 && $0 ~ /NEEDS_FSCK_CHECK/ {
|
||||
sub(/yes/, "")
|
||||
}
|
||||
{
|
||||
print
|
||||
}
|
||||
' /usr/lib/update-notifier/update-motd-fsck-at-reboot.bak \
|
||||
| sudo tee /usr/lib/update-notifier/update-motd-fsck-at-reboot >/dev/null
|
Loading…
Reference in New Issue
Block a user