LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-14-2015, 08:17 AM   #1
f4u5t
LQ Newbie
 
Registered: Aug 2015
Posts: 1

Rep: Reputation: Disabled
autorun a script for for one user


I have a raspberry pi running debian and I have a small gui script I want to run on the attached touchscreen.
If i include it in /etc/profile, it is ran even when I ssh into it as a diff user.
What would be the best way for me to auto launch my script on the local dispaly but not interfere with my ssh sessions?
thanks
 
Old 08-14-2015, 01:44 PM   #2
ShadowCat8
Member
 
Registered: Nov 2004
Location: San Bernardino, CA
Distribution: Gentoo, Arch, (RedHat4.x-9.x, FedoraCore 1.x-4.x, Debian Potato-Sarge, LFS 6.0, etc.)
Posts: 261

Rep: Reputation: 52
Greetings,

How about adding something like this to your individual user's ~/.bash_profile file:
Code:
if [ -z "$SSH_CLIENT" ] && [ -z "$SSH_TTY" ]; then
     # Call/Execute GUI script here
     
     fi
Then take it out of /etc/profile since ALL users will likely source that on every session startup.

HTH. Let us know.

Last edited by ShadowCat8; 08-14-2015 at 01:54 PM. Reason: Added home dir reference, cleaned up example
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with a autorun script ut0ugh1 Programming 2 09-24-2012 07:11 AM
Which style for autorun script is better: prompt console(.sh) or GUI(.py) Weining Linux - Software 3 09-25-2009 05:20 PM
Autorun Backup script before shutdown!!!!! jp286 Linux - Networking 1 11-25-2008 10:29 AM
any way I can autorun a script before when shutdown Niceman2005 Linux - General 4 03-03-2006 05:40 PM
Autorun.sh script to mount CD and run .bin file kulkarni08 Linux - General 2 06-24-2003 01:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:12 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration