Current File : //scripts/postkillacct
#!/bin/bash
# Bash script to be executed after an account termination
# Vanessa V. 4/13/2011

# Argument structure
# /scripts/postkillacct killdns <1|0> user <user>

DIR="/opt/backup/"

# Assign fourth argument as user
USER=$4

if [ "$USER" != " " ]; then
    if [ -d $DIR ]; then
    # Create maint structure, if doesn't already exist
        if [ ! -d $DIR/del ];then
            mkdir -p $DIR/del
        fi

    # Copy the username into the directory
        echo "terminated" > $DIR/del/$USER
    fi
fi