Shell Scripts





Español Français 中文 Deutsch Portuguese Japanese nederlands
   
 
Free Shell Scripts
List All
Rename File
Rename Multiple Files
Remove Files From Folder
Fun Dancing Script
Dancing Move
FTP Login Report
Netstats

 





outsourced web hosting support

FTP Server Login Details Script


About
Simple yet powerful shell script to check the FTP server login details. The script generates ftp server accessing reports upon execution.


Features
a) Used to check ftp login details.
b) Just copy the code and use it in your command line.
c) Execute the script as a root user and find out the login details.

Code
#------------------  Script by hscripts.com    ------------------#
#-----------------   Copywrite of HIOXINDIA    ------------------#
#--------------  More scripts @www.hscripts.com   ---------------#


awk -F: '{ if($3>=500) print $1 }' /etc/passwd > userslist.txt
ddm=$IFS
IFS=" "
dt=`date +%d`
if [ $dt -gt 9 ];then
logdate=`date | cut -d" " -f2,3`
else
logdate=`date | cut -d" " -f2,3,4`
fi
nolines=`cat userslist.txt | wc -l`
lineno=1
echo > ftprep.txt
while [ $lineno -lt $nolines ] || [ $lineno -eq $nolines ]
do
        user=`sed -n "${lineno}p" userslist.txt`
        lineno=`expr $lineno + 1`
        nologs=`cat /var/log/messages | grep 'pure-ftp' | grep "$logdate" | grep $user | grep 'logged in' | wc -l`
        if [ $nologs -gt 0 ]; then
                echo -e $user '\t' $nologs times >> ftprep.txt
        fi
done
hostname=`hostname`
email='support@hioxindia.com'
(echo FTP Login Report;echo ----------------------;sort  +1 -2 -n -r ftprep.txt) | mail -s "FTP report for $hostname" $email

#------------ Script by hscripts.com -------------------------#

Release Date - 06-04-2010
Get free version without ©copyright link for just 5 price

For customization of this script or any script development, contact us at support@hscripts.com



Usage
a) Copy the above code and save it with .sh extension
b) This script is used in server side only.
c) Execute the shell script as root user with the filename sh filename.sh.
d) Check the FTP server login details.


License
- The Unix Shell Scripts and examples is given under GPL License
- i.e. Free use for those who use it as it is.
- Free, if your modification does not remove our copyright information and links.
- For Detailed License information Click here
- If your requirements does not meet GPL License terms, you can purchase the script with us.
Other Links

web hosting