AutomountFile(3pm)

πŸ’– AutomountFile(3pm) β€” like, the Perl way to talk to automounter files πŸ’–

Unix::AutomountFile β€” a Perl interface to automounter files. Yes bestie, this is the User Contributed Perl Documentation page and we are so getting into it. πŸ¦‹


✨ NAME ✨

Unix::AutomountFile β€” a whole Perl interface to automounter files, no cap. πŸ’…


🌸 SYNOPSIS 🌸

use Unix::AutomountFile;

$am = new Unix::AutomountFile "/etc/auto_home";
$am->automount("newuser", "fileserver:/export/home/&");
$am->options("newuser", "-rw,nosuid");
$am->delete("olduser");
$am->commit();
undef $am;

πŸŽ€ DESCRIPTION πŸŽ€

okay so the Unix::AutomountFile module gives you an abstract interface to automounter files. It lowkey handles all the annoying stuff for you β€” file locking, putting the colons and commas in the right places, and every other niggling little detail you do not want to deal with. ✨

⚠️ WARNING: This module is probably Solaris specific at this point, fr fr. The author has only looked at Solaris format automount files thus far. 😭 Also β€” and this is important β€” you cannot edit /etc/auto_master with this module, because it's in a different format than the other automount files. Periodt. πŸ’€

πŸ‘‘ METHODS πŸ‘‘

🌈 add_server( MOUNT, @SERVERS )

This method will add additional servers to an existing automount point. It returns 1 on success and 0 on failure. Slay. πŸ’–

🌈 automount( MOUNT [,@SERVERS] )

This method can add, modify, or return info about a mount point. Give it a single mount parameter and it returns a list of the server entries for that mount point β€” or undef if no such mount exists. πŸ™ˆ

If you supply more than one parameter, the mount point gets created (or modified, if it already exists). The list is also returned to you in this case. 🫢

🌈 automounts( )

This method returns a list of all existing mount points, sorted alphabetically. πŸ“ In scalar context, it returns the total number of mount points instead. Vibe check passed.

🌈 commit( [BACKUPEXT] )

See the Unix::ConfigFile documentation for a description of this method. iykyk. πŸ’…

🌈 delete( MOUNT )

This method deletes the named mount point. It has no effect if the supplied mount point doesn't exist β€” so no dramatic errors, it just shrugs. 🧚

🌈 new( FILENAME [,OPTIONS] )

See the Unix::ConfigFile documentation for a description of this method. ✨

🌈 options( MOUNT [,OPTIONS] )

Read or modify the mount options associated with a mount point. Returns the options in either case. Both directions, iconic. πŸ‘‘

🌈 rename( OLDNAME, NEWNAME )

Renames a mount point. If NEWNAME corresponds to an existing mount point, that mount point gets overwritten β€” sorry to whoever was there. 😭 Returns 0 on failure and 1 on success. πŸ’œ


πŸ’œ AUTHOR πŸ’œ

Steve Snodgrass, ssnodgra@fore.com β€” king behavior. πŸ‘‘


πŸ¦‹ SEE ALSO πŸ¦‹

  • Unix::AliasFile
  • Unix::ConfigFile
  • Unix::GroupFile
  • Unix::PasswdFile

and that's the whole page, bestie! This one shipped as part of perl v5.32.1, dated 2021-08-21 β€” so go forth, lock your files, place your colons and commas correctly, and stan a Solaris-specific module. πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈπŸ’…πŸ«Ά

πŸ“¦ where this page comes from