Announcing a restart to the Network
I'm running Linux as a server and I wish to announce when the system will be rebooting to the network. I have Windows users connecting via SMB and I wish to broadcast a message stating that the server will be rebooting in two minutes, please save all of your work now!
How could I do this? thank you. |
|
Hi Darth,
Thank you. However, is that for a broadcast over a network?? I don't have the time right now to look at in close detail, but from the little I saw, it would appear that is for a user sitting at the Linux box. The message needs to be broadcast accross the network to my Windows clients. I'll take a closer look at it later, but are you sure that's what this is for? |
You can send popups with smbclient. I don't know the syntax but I worked in an environment where that was done. I think it was:
smbclient -M or something like that. |
The command is:
smbclient -M <name of computer you want to message> You then get a prompt where you can enter your message I only have one other computer on my network, so I am not sure whether you can enter multiple names at the command line or not. |
Very good. That worked. However, to run an automated message at a particular time??? Say, for example, the server will be rebooting in 5 minutes, save your work now!!
I want to shove that into cron 5 minutes before the server will restart. I started a script to do it. It's not working though. How would I automate this?? What has happened when I ran it is it runs the smbclient -M but does not send the message in the script. Perhaps I'll ask a friend of mine. This is what I have so far. . . To force the system to do ctrl-d and send that message I'm not sure about. Any ideas? ------------------------------------------------------------------------------------------------- # This script will send a winpopup message to the smbclients in your workgroup smbclient -M hp-pavilion-pi The Linux Server will be rebooting in 5 minutes. . . Please save all of your work now!! |
Hi Everyone,
Well, I thought I would share with you my solution. If anyone has any better ideas, I'm all ears. This is what I did: I made three separate text files (for 5 min, 3 min, and 1 min) for the different warnings. They are named: restart5.txt restart3.txt restart1.txt Then, I made 3 short shell scripts to execute them: restart5.sh # This script will send a WinPop message to the Windows Clients 5 minutes # prior to restart. cat restart5.txt | smbclient -M hp-pavilion-pi restart3.sh # This script will send a winpop to the Windows machines 3 min before restart cat restart3.txt | smbclient -M hp-pavilion-pi And so on. . . Next I plugged the scripts into CRON to run at the appropriate times. Maybe that's a backwards way of doing it, but again, if someone else has any better ideas, I'm totally all ears!! |
You could wrap it into one script and use the at command and take it out of CRON.
|
Umm, how would I do that???
|
All times are GMT -5. The time now is 09:14 PM. |