The tag has no wiki summary.

learn more… | top users | synonyms

26
votes
3answers
2k views

Can a bash script be hooked to a file?

I want a script to sleep unless a certain file is modifed/deleted (or a file created in a certain directory, or ...). Can this be achieved in some elegant way? The simplest thing that comes to my mind ...
8
votes
2answers
2k views

Ssh login hook?

Is there a way to run a script/command every time a user connects using ssh? Can it be configured globally (i.e run the script when any user login)? I came across this question on Identica, but there ...
6
votes
3answers
4k views

How to execute a script on gdm login automatically for all users?

What file should I modify to execute some instructions when any user logs in through gdm? I tried /etc/bashrc but that is executed ony when starting bash (and each time an xterm is open). I'd like to ...
4
votes
4answers
360 views

Run command when temperature exceeds threshold, without daemon

I need to run a specific command if my laptop gets too hot (for example, send a STOP signal to Firefox or Virtualbox in order to prevent my laptop from shutting down violently and damaging my hard ...
4
votes
2answers
60 views

Falling to git checkout on non-found bash commands

When I type (in bash) a command which linux does not find, it usually does something like this: $ x x: command not found but when I type a command which is not found but which is similar in some ...
3
votes
2answers
152 views

Encrypt hook in mkinitcpio.conf for full system encryption USB drive Arch install

I have installed Arch Linux on a USB drive with full system encryption using LUKS. The Arch wiki as usual walked me through almost everything. The only issue I ran into was using setting up the hooks ...
1
vote
1answer
536 views

How to preload my .so everytime an application executes?

I've successfully used a hook under linux with this article: http://hackerboss.com/overriding-system-functions-for-fun-and-profit/ Now I want to make my .so file load every time espeak loads up. No ...
1
vote
1answer
531 views

Trigger action each time a file is modified [duplicate]

Possible Duplicate: Can a bash script be hooked to a file? Is it possible to mount a mechanism to a file to perform an action (e.g. mark the change in some log file and such) each time the ...
1
vote
1answer
33 views

gphoto2 hook scripts - a guide?

I posted this on raspberrypi.stackexchange but was directed here. I'm new to Linux / Unix, and I'm trying to get a tether / display script going with gphoto2. gphoto2 --capture-tethered ...
1
vote
1answer
73 views

Forcing keys to run bash scripts

Is it possible to define bash scripts for all keys on keyboard so that by pressing any key the bash script for that key will be run? The scripts may do anything, for instance they may save the key ...
1
vote
1answer
396 views

Set environment variable for all of tmux shells when gnome-sessions gets restarted

To solve this problem, I need to set the environment variable DBUS_SESSION_BUS_ADDRESS for all shells inside tmux every time I restart gnome without restarting tmux (this is often). How can I best ...
1
vote
0answers
90 views

Can I install a sync completion hook with rsync daemon?

Like hooks in svn or git, can I install a server-side hook script for rsync daemon? For sync completion event. I am using FreeBSD9/rsyncd.
1
vote
0answers
248 views

How can I make scripts run when a file/directory changes in Linux (like Mac OS X’s launchd)? [duplicate]

Possible Duplicate: Can a bash script be hooked to a file? On Mac OS X, there’s a handy daemon called launchd which (amongst other things) allows you to have scripts run when files or ...