4.13. Before and After Commands

As Section 4.12 “Configuring the Users and Groups Module” explains, you can specify shell commands to be run before and after any action is taken in the module. Because these commands are called for every addition, modification, or deletion of a user or group, they need some way of telling exactly what action is being performed. They can do this using environment variables that are set before the command is run. The available environment variables are shown in Table 4.3.

If you wanted to send out email when a user is created, for example, you could set the Command to run after making changes option to:

[ "$USERADMIN_ACTION" = "CREATE_USER" ] && echo "Added user $USERADMIN_USER 
($USERADMIN_REAL)" | mail –s "Added new user" [email protected]

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.14.248.69