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::AliasFileUnix::ConfigFileUnix::GroupFileUnix::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
- debian bookworm: libunix-configfile-perl 0.6-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libunix-configfile-perl 0.6-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: libunix-configfile-perl 0.6-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libunix-configfile-perl 0.6-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libunix-configfile-perl 0.6-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libunix-configfile-perl 0.6-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms