How can I run a command before my laptop suspends and loses network connection?

0
13
Asked By CuriousOtter92 On

I'm trying to execute the command `/usr/bin/curl -s -X POST https://domain.com/webhook` when my laptop enters suspend mode. The challenge I'm facing is that NetworkManager disconnects the Wi-Fi too quickly for me to run this command successfully. I'm currently using `s2idle`. If anyone has suggestions on how to ensure the command runs before the network goes down, I'd really appreciate your help!

2 Answers

Answered By InquisitivePenguin45 On

The reason behind wanting this is that I don't fully trust my laptop during suspend. If I have to close the lid unexpectedly, I want a notification on my phone to know it went into suspend mode.

Answered By SkepticalHiker77 On

Honestly, I'm curious about the need for this. Why do you want to send a notification when your laptop suspends?

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.