Skip to content

Commit

Permalink
proftpd: converting to /bin/sh
Browse files Browse the repository at this point in the history
Some cleanup
  • Loading branch information
steveschnepp committed Aug 4, 2014
1 parent e3cc768 commit d405620
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions plugins/ftp/proftpd
@@ -1,6 +1,9 @@
#!/bin/bash
#! /bin/sh
# configuration :
#
# env.LOGFILE /var/log/proftpd/proftpd.log

if [[ $1 == 'config' ]]; then
if [ "$1" = 'config' ]; then
echo "graph_args --base 1000 -l 0"
echo "graph_title Serveur FTP"
echo "graph_category Ftp"
Expand All @@ -11,8 +14,12 @@ if [[ $1 == 'config' ]]; then
echo "failed.draw AREA"
fi

succes=`cat /var/log/proftpd/proftpd.log | grep -c "successful"`
failed=`cat /var/log/proftpd/proftpd.log | grep -c "Login failed"`
LOGFILE=${LOGFILE:-"/var/log/proftpd/proftpd.log"}

succes=$(grep -c "successful" "$LOGFILE" )
failed=$(grep -c "Login failed" "$LOGFILE" )

echo "succes.value $succes"
echo "failed.value $failed"

exit 0

0 comments on commit d405620

Please sign in to comment.