diff options
author | Peter Palfrader <peter@palfrader.org> | 2005-09-02 01:31:04 +0000 |
---|---|---|
committer | weasel <weasel@bc3d92e2-beff-0310-a7cd-cc87d7ac0ede> | 2005-09-02 01:31:04 +0000 |
commit | 45b83e3a4dc979f2a4b8619b371272c4c499a71e (patch) | |
tree | 883d850b57847f49383aa7c18dc0d949eab1be72 | |
parent | 746d3a1f2a45df3c7d5233692e6bc9014065565e (diff) |
Run postcommand from root and with clean env
git-svn-id: svn+ssh://asteria.noreply.org/svn/weaselutils/trunk@7 bc3d92e2-beff-0310-a7cd-cc87d7ac0ede
-rwxr-xr-x | recvconf | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -143,7 +143,7 @@ if [ -s "$tempscript" ]; then ## Post-copying commands to be run, run them here. Only display output if they exit with $? > 0 while read command; do printf "Running postcommand \`%s' on %s.\n" "$command" "$(hostname -s)" >&2 - if ! eval -- "$command" > "$tempoutput" 2>&1; then + if ! eval -- "cd / && env -i $command" > "$tempoutput" 2>&1; then printf "Error, postcommand \`%s' on %s failed. Output follows:\n" "$command" "$(hostname -s)" >&2 cat -- "$tempoutput" >&2 exit 1 |