Some scripts may be executed as share connection/disconnection time.
This option specifies a command to be run whenever the service is connected to. It takes the usual substitutions.
An interesting example is to send the users a welcome message every time they log in. Perhaps a message of the day? Here is an example:
csh -c 'echo \"Welcome to %S!\" | \ /usr/local/samba/bin/smbclient
-M %m -I %I' &
Of course, this could get annoying after a while :-)
See also Cleanup Command.
Default: None (no command executed)
Example: echo \"%u connected to %S from %m (%I)\" >> /tmp/log
This is the same as Setup Command except that the command is run as root. This is useful for mounting filesystems (such as CD-ROMs) before a connection is finalized.
This option specifies a command to be run whenever the service is disconnected. It takes the usual substitutions. The command may be run as root on some systems.
An interesting example may be:
/sbin/umount /mnt/cdrom
See also Setup Command.
Default: None (no command executed)
Example: echo \"%u disconnected from %S from %m (%I)\" >> /tmp/log
This is the same as postexec except that the command is run as root. This is useful for unmounting filesystems (such as CD-ROMs) after a connection is closed.