I have two hashes in the form of "mount_point = NFS_Server:source". The first hash, %curr, lists the currently mounted NFS exports on a system. The second hash, %mounts, lists the correct mounts.
Anything in %curr that does not exist in %mounts should be unmounted. Anything in %mounts that does not exist in %curr, needs to be mounted.
The output should look something like this:
MOUNT: serverF:/oracle on /oracle
MOUNT: serverA:/appC on /appC
MOUNT: serverZ:/mysql on /mysql
UNMOUNT: /appA
UNMOUNT: /oracle
UNMOUNT: /temp
I'm just comparing these hashes to make sure their key=value pairs match. Any ideas?
Thanks,
Chris
Code:
%curr = (
'/appA' => 'serverA:/appA',
'/db' => 'serverB:/db',
'/oracle' => 'serverC:/oracle',
'/temp' => 'serverX:/temp'
);
%mounts = (
'/appC' => 'serverA:/appC',
'/db' => 'serverB:/db',
'/oracle' => 'serverF:/oracle',
'/mysql' => 'serverZ:/mysql'
);
Anything in %curr that does not exist in %mounts should be unmounted. Anything in %mounts that does not exist in %curr, needs to be mounted.
The output should look something like this:
MOUNT: serverF:/oracle on /oracle
MOUNT: serverA:/appC on /appC
MOUNT: serverZ:/mysql on /mysql
UNMOUNT: /appA
UNMOUNT: /oracle
UNMOUNT: /temp
I'm just comparing these hashes to make sure their key=value pairs match. Any ideas?
Thanks,
Chris