Compare commits
2 commits
df607f0656
...
fab4d0a476
Author | SHA1 | Date | |
---|---|---|---|
![]() |
fab4d0a476 | ||
![]() |
cf6e716301 |
3 changed files with 7 additions and 2 deletions
|
@ -22,7 +22,7 @@ do
|
|||
done
|
||||
|
||||
LOGINS=$(who -u | grep pts\/ | wc -l)
|
||||
if ! [[ "$LOGINS" =~ "^0$" ]]
|
||||
if [[ "$LOGINS" -gt 0 ]]
|
||||
then
|
||||
echo "ABORT: $LOGINS user logins"
|
||||
exit 0
|
||||
|
|
|
@ -24,7 +24,7 @@ def wake_command(metadata):
|
|||
|
||||
return {
|
||||
'wol-sleeper': {
|
||||
'wake_command': f"ssh wol@{waker_hostname} 'wakeonlan {mac} && while ! ping {ip} -c1 -W3; do true; done'",
|
||||
'wake_command': f"ssh -o StrictHostKeyChecking=no wol@{waker_hostname} 'wakeonlan {mac} && while ! ping {ip} -c1 -W3; do true; done'",
|
||||
},
|
||||
}
|
||||
|
||||
|
|
5
hooks/wake_on_lan.py
Normal file
5
hooks/wake_on_lan.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
from bundlewrap.operations import run_local
|
||||
|
||||
def node_apply_start(repo, node, interactive=False, **kwargs):
|
||||
if node.has_bundle('wol-sleeper'):
|
||||
repo.get_node(node.metadata.get('wol-sleeper/waker')).run(node.metadata.get('wol-sleeper/wake_command'))
|
Loading…
Reference in a new issue