Results 1 to 2 of 2
I need to know how / where to put a script that executes only for 1 username (actone) at login.
I have the script already done.
AND:
How can I ...
- 12-13-2010 #1Just Joined!
- Join Date
- Jul 2010
- Posts
- 15
Startup script ONLY for 1 user
I need to know how / where to put a script that executes only for 1 username (actone) at login.
I have the script already done.
AND:
How can I set a timeout for just this one user? So after they are connected for 2 minutes they get kicked off.
Lastly:
At the end of a script how can I force an exit so the user is exited from the session?
- 12-14-2010 #2
Could put it at the end of his/her .bashrc file and with a timer run:
Here's a timer script I use to kill other scripts, might have to edit it a bit.Code:pkill -KILL -u actone
Code:#!/bin/bash # # Timer script to kill a running process. # Usage: timer.sh minutes process_name # if [[ ! $1 || ! $2 ]]; then echo "Usage: timer.sh minutes process_name" exit 1 fi declare -i SEC=$1*60 declare -i STARTTIME=$(date +%s) declare -i STOPTIME=$STARTTIME+$SEC declare -i DIFFTIME=$STOPTIME-$STARTTIME while [ $DIFFTIME -gt 0 ] do DIFFTIME=$DIFFTIME-1 sleep 1 done killall -s 9 $2 exit 0


Reply With Quote
