Skip to content

Commit

Permalink
impreovements
Browse files Browse the repository at this point in the history
  • Loading branch information
jakerundall committed Dec 6, 2023
1 parent 2acaebc commit d8a886d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
15 changes: 7 additions & 8 deletions templates/quota.csh.epp
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
# quota.csh: Managed by Puppet

# if the user is in $profile_user_environment::quota::skip_users, exit
# if the user is NOT in $profile_user_environment::quota::skip_users, run the scripts
whoami | egrep -q '^(<%= join($profile_user_environment::quota::skip_users, "|") %>)$'
if ( $? == 0 ) then
exit 0
endif
if ( $? != 0 ) then

# run quota scripts
echo ""
# run quota scripts
echo ""
<% $profile_user_environment::quota::command_paths.each |$path| { -%>
timeout <%= $profile_user_environment::quota::timeout_interval %> <%= $path %>
echo ""
timeout <%= $profile_user_environment::quota::timeout_interval %> <%= $path %>
echo ""
<% } -%>

endif
17 changes: 9 additions & 8 deletions templates/quota.sh.epp
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# quota.sh: Managed by Puppet

USERNAME=`whoami`
# if the user is NOT in $profile_user_environment::quota::skip_users, run the scripts
whoami | egrep -q '^(<%= join($profile_user_environment::quota::skip_users, "|") %>)$'
if [[ $? != 0 ]]; then

# if the user is in $profile_user_environment::quota::skip_users, exit
[[ "$USERNAME" =~ ^(<%= join($profile_user_environment::quota::skip_users, "|") %>)$ ]] && exit 0

# run quota scripts
echo
# run quota scripts
echo
<% $profile_user_environment::quota::command_paths.each |$path| { -%>
timeout <%= $profile_user_environment::quota::timeout_interval %> <%= $path %>
echo
timeout <%= $profile_user_environment::quota::timeout_interval %> <%= $path %>
echo
<% } -%>

fi

0 comments on commit d8a886d

Please sign in to comment.