Log in | Jump |

Modified Penguin.com

A journey through the digital world with the help of friends and caffeine.

This code is a test with databases and printing active users within a user input time frame. (Unfinished)

#! /bin/bash

# Variables
file=$1
database=$2
username=$3
password=$4
startdate=$5
DATE=`date '%Y/%m/%d %H:%M'`

echo -e "Please enter path of Database to examine."
read file;

file [ $file ]; | awk '{print $2}'

if [ $file == ASCII ];
then
echo -e "Specify how far back to look. (Use year/month/day hour:minute format IE 2010/04/01 23:59)"
read startdate;
cat [ file ]; | awk '$0>=from&&$0< =to' from=[ $startdate ]; to=[ $DATE ]; > tmp.log
echo -e ls -lart tmp.log | awk '{print $2 " Users"}'
else
if [ $file == Binary ];
then
echo -e "This file is Binary and requires user input"
echo -e "Enter username"
read username;
echo -e "Enter password"
read password;

# In here is where the mysql.sql file pulls the variables for database, username, password
# Then it runs a search for files in between dates specified by the user above and saves it
# to a sql.log file.

echo -e ls sql.log | awk '{print $(line number) " Users still active"}'

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*