[linux-elitists] Per-user network up and down scripts
Sun Dec 7 21:01:48 PST 2008
begin Don Marti quotation of Fri, Dec 05, 2008 at 08:48:40AM -0800:
> For actions that aren't associated with long-running
> apps, we just need a script under /etc/network that
> will run per-user scripts for users who are members
> of the "netdev" group.
first whack at that -- this can be installed in any
or all of the /etc/network/*.d directories...
# let users in the netdev group run their own actions
# by putting a file in $HOME/.network/*.d
for user in `getent group netdev | cut -d : -f 4 | tr ',' "\n"`; do
home=`getent passwd $user | cut -d : -f 6`
# make the directory names match the ones in /etc/network
case $PHASE in
if [ -d "$home/.network/$script_dir" ]; then
su $user -c "/bin/run-parts $home/.network/$script_dir"
Don Marti +1 510-814-0932
http://zgp.org/~dmarti/ +1 510-332-1587 mobile
See you at OpenSource World: August 10-13, 2009 in San Francisco
More information about the linux-elitists