Ping all domains on my shell server


console

Sometimes we need to verify if all the email accounts that we have created on our server are really working correctly.

For this problem, the Shell console (based on LINUX) has provides us with a practical solution:

for variable in `cat / etc / localdomains`;
do
done

This option allows us to ping all our domains, however, what if I have thousands of accounts? Unfortunately, the console will not be able to show us all the results.

To solve this new problem, we can save the ping results to a text file. We must first create a .txt file at any address within our server.

The final code would be as follows:

for variable in `cat / etc / localdomains`;
do
ping -c 1 $variable >> /home/user/public_html/filename.txt;
done

 

To finish we must go to the file path and review the content.

Previous Did you run out of access to the backend when activating the plugin?
Next Create a strong password

No Comment

Leave a reply

Your email address will not be published. Required fields are marked *