Skip to content

Instantly share code, notes, and snippets.

@jessetane
Created December 14, 2012 00:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jessetane/4281324 to your computer and use it in GitHub Desktop.
Save jessetane/4281324 to your computer and use it in GitHub Desktop.
#
# user-jobs.conf
#
description "start user jobs when networking is up"
start on net-device-up
script
cat /etc/passwd | while read LINE
do
USER=$(echo $LINE | cut -d: -f1)
USER_HOME=$(echo $LINE | cut -d: -f6)
if [ -d "$USER_HOME/.init" ]
then
ls $USER_HOME/.init | while read JOB
do
sudo -u $USER start ${JOB%.*}
done
fi
done
end script
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment