display0 Posted August 7, 2022 Share Posted August 7, 2022 Hello. I would like to run a script in user scripts to power down the server after 2 invalid login attempt. I've been searching the forum but haven't found anything similar. The server could be doing some tasks so if a graceful shutdown is an option that would be preferred. Would something like that be able to achieve? I'm on 6.10.3 if that matters. Thank you. Quote Link to comment
trurl Posted August 8, 2022 Share Posted August 8, 2022 Have you tried scheduling shutdown from the script with at command? Quote Link to comment
display0 Posted August 8, 2022 Author Share Posted August 8, 2022 5 minutes ago, trurl said: Have you tried scheduling shutdown from the script with at command? No i haven't. I don't want it to be on a schedule - i want the server to power down when there is a second invalid login attempt. So maybe a script isn't what i need. Is there any way to achieve this? Quote Link to comment
trurl Posted August 8, 2022 Share Posted August 8, 2022 I didn't suggest you put it "on a schedule". google linux 'at' command. The reason I suggested it is because I thought perhaps if you tried to run a script that directly executed shutdown, the shutdown wouldn't complete until the script completed, and the script couldn't complete until the shutdown command completed, so hung. If you 'at' the shutdown command to run very soon, then the script could exit after the 'at' command completed, then the 'at' would execute shutdown. Quote Link to comment
kizer Posted August 8, 2022 Share Posted August 8, 2022 You could tinker with this some. Obviously you want to change the script so it doesn't wipe out your machine, but instead tell it to watch your logs and preform a shutdown instead. https://www.reddit.com/r/unRAID/comments/vrinun/dead_mans_switch/?utm_source=BD&utm_medium=Search&utm_name=Bing&utm_content=PSR1 Quote Link to comment
display0 Posted August 13, 2022 Author Share Posted August 13, 2022 On 8/8/2022 at 5:33 PM, trurl said: I didn't suggest you put it "on a schedule". google linux 'at' command. The reason I suggested it is because I thought perhaps if you tried to run a script that directly executed shutdown, the shutdown wouldn't complete until the script completed, and the script couldn't complete until the shutdown command completed, so hung. If you 'at' the shutdown command to run very soon, then the script could exit after the 'at' command completed, then the 'at' would execute shutdown. Oh I understand now. Sounds like a good idea. I will try using the at command. Thank you for your input. Quote Link to comment
display0 Posted August 13, 2022 Author Share Posted August 13, 2022 On 8/8/2022 at 5:42 PM, kizer said: You could tinker with this some. Obviously you want to change the script so it doesn't wipe out your machine, but instead tell it to watch your logs and preform a shutdown instead. https://www.reddit.com/r/unRAID/comments/vrinun/dead_mans_switch/?utm_source=BD&utm_medium=Search&utm_name=Bing&utm_content=PSR1 I've read the post and looked at the script. It looks promising. I will have to learn some scripting to modify it. Thank you for your input. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.