CBAIS::Actions::Symlink - create symbolic links
$symlink = new CBAIS::Actions::Symlink(TARGET => '/etc/hosts', LINK=> '/etc/inet/hosts');
if ($symlink->execute())
{
print ``symlinked /etc/inet/hosts -> /etc/hosts\n'';
}
if ($symlink->undo())
{
print ``removed symlink /etc/inet/hosts\n'';
}
The CBAIS::Actions::Symlink class implements a CBAIS action which creates symbolic links. The verify and undo operations are also supported.
The constructor recognises the following keys
The following demonstrates a relative and absolute symlink configuration in a class file.
{ action => 'symlink', target => '/etc/ntp/ntp.conf', link => '/etc/ntp/ntp.symlink',
},
{ action => 'symlink', target => '../hosts', link => 'passwd.symlink', dir => '/etc/ntp',
},