Register
It is currently Sun Dec 21, 2014 10:29 pm

shell refresh


All times are UTC - 6 hours


Post new topic Reply to topic  [ 2 posts ] 
Author Message
 PostPosted: Sat Sep 01, 2012 3:46 am   

Joined: Sun Aug 05, 2012 4:20 pm
Posts: 7
Hey,

i have added the below to my users .bashrc files but when they login it just keeps sourceing the bashrc (thats what it looks like)

Code:
#!/bin/bash
# Capture keystrokes of a user and log

TIMESTAMP=$(date +%m%d%y%H%M%S)
HOST=$(hostname|cut -f1 -d.)
LOGDIR=/var/log/user
LOGFILE=${HOST}.${LOGNAME}.${TIMESTAMP}
touch $LOGDIR/$LOGFILE

# Set Prompt
export PS1=”[$LOGNAME:$HOST]@”‘$PWD> ‘

chown $LOGNAME ${LOGDIR}/${LOGFILE}
chmod 600 ${LOGDIR}/${LOGFILE}

script ${LOGDIR}/${LOGFILE}
chmod 400 ${LOGDIR}/${LOGFILE}


Any ideas?

Regards


Top
 Profile  
 PostPosted: Mon Sep 24, 2012 7:53 am   

Joined: Mon Sep 24, 2012 7:48 am
Posts: 5
Try commenting out the script line. I think it forks a new copy of bash.

BTW, the chown line is pointless. If a regular user doesn't already own a file, he can't change ownership.


Top
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP