Generate the user and group names

Also check if the the user already exists.
This commit is contained in:
David Coppit
2015-06-26 00:19:25 -04:00
parent 44f8af4a50
commit 3888123dcd
2 changed files with 26 additions and 22 deletions

View File

@@ -219,11 +219,8 @@ do
# Wait until it's okay to run the command again, monstering up events as we do so
wait_for_minimum_period $last_run_time
# Generate a user from the MD5 of the config file
USER=$(md5sum $CONFIG_FILE | awk '{print $1}')
echo "$(ts) Running command"
/files/runas.sh $USER:$USER_ID:$GROUP_ID $COMMAND &
echo "$(ts) Running command with user ID $USER_ID and group ID $GROUP_ID"
/files/runas.sh $USER_ID $GROUP_ID $COMMAND &
PID=$!
last_run_time=$(date +"%s")