[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [K12OSN] disallowing multiple instances within a certian period.



On 11/15/05, Peter Hartmann <ascensiontech gmail com> wrote:
> > I can pull out the script if you need.
>
> Sure that would be great.
>

The script is below (watch out if any  line is wrapped round):

p=`ps -u $USER | grep dosemu | wc -l`
q=`cat /etc/dosid.conf | grep $USER | cut -d ":" -f 2`
if [ $q -gt $p ]
then
	echo "execute here"
	/path/to/program
else
	dialog --title "Linux Dialog Utility Msgbox" --backtitle "Linux Alert
Message" --msgbox "You are already running maximum permitted sessions
\n  Press any key. .. " 9 50
fi

We have defined maximum sessions for each user in the file
/etc/dosid.conf so that some users are allowed to run only one session
while others can run two or three. File layout is :
usera 1
userb 2
userc 1.......

--
Sudev Barar
Learning Linux


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]