Difference between revisions of "Script Prototypes"

From Nuclear Physics Group Documentation Pages
Jump to navigationJump to search
 
(10 intermediate revisions by 2 users not shown)
Line 1: Line 1:
== setres ==
+
==Einstein/Lentil checkup==
Bash function for remotely setting ''/etc/resolv.conf'' to the proper values:
+
There are probably some other critical services that should be added to this list, although many are checked implicitly if the user can log into a non-einstein machine (LDAP, NFS).
<pre>function setres
+
<pre>#!/bin/bash
{
+
 
    home=~
+
ssh root@einstein "df -h; service spamassassin status; service amavisd status; service postfix status"
    master="$home/bin/master_resolv.conf"
+
ssh root@lentil "df -h /mnt/npg-daily-current"
    scp $master root@$1:/etc/resolv.conf
+
</pre>
}</pre>
 
Would be better if the function checked to see if the file didn't exist, and if not, created it.  Or maybe it would be better to have the "master" file on a specific machine.  Actually, even better would be a program that maps settings to files.
 

Latest revision as of 14:16, 15 February 2008

Einstein/Lentil checkup

There are probably some other critical services that should be added to this list, although many are checked implicitly if the user can log into a non-einstein machine (LDAP, NFS).

#!/bin/bash

ssh root@einstein "df -h; service spamassassin status; service amavisd status; service postfix status"
ssh root@lentil "df -h /mnt/npg-daily-current"