Created
December 14, 2012 00:10
-
-
Save jessetane/4281324 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# 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