#!/bin/bash

this_script="$(basename $0)"

# -----------------------------------------------------------------------------
print_usage_and_exit() {
    echo
    echo "Usage: $this_script <username> <ftpgroup>"
    echo
    echo -e "\tThis script add the specified user name to the provided ftp"
    echo -e "\tgroup name."
    echo
    exit 1    
}

# --- main --------------------------------------------------------------------

if [ "$#" -ne "2" ] ; then
    print_usage_and_exit
fi

user_name=$1
ftp_group=$2

rm -rf /etc/vsftpd_user_conf/$user_name
ln -s /etc/vsftpd_user_conf/$ftp_group /etc/vsftpd_user_conf/$user_name
