before and after command

  • PkStud

    if read about before and after command on wiki there was an example that if you want to email the particular user about the user creation place the following command in after command box:

    && echo "Added user $USERADMIN_USER ($USERADMIN_REAL)" | mail -s "Added new user"

    i took this example and modified it so before deleting a user it should first kill all the process under that particular user and for that i made a small bash script (killuser) that would calculate all the pids running under that user and placed the following command under before command box:

    && echo "Deleted process under  $USERADMIN_USER"  | killuser $USERADMIN_USER

    it worked fine under the deletion process of the user but as soon as you create a new user you get this error:

    Failed to save user : Before update command failed

    can anyone help me please