Mercurial > pkg
diff previous-work/more_control_helpers/lib/chown @ 1:d6bef198ae71
add work by Matthias S. Benkmann which is the inspiration for this project.
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Tue, 08 Jan 2013 11:45:01 +0000 |
parents | |
children |
line wrap: on
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/previous-work/more_control_helpers/lib/chown Tue Jan 08 11:45:01 2013 +0000 1.3 @@ -0,0 +1,30 @@ 1.4 +#!/bin/bash 1.5 +# Copyright (c) 2000,2004 Matthias S. Benkmann <article AT winterdrache DOT de> 1.6 +# You may do everything with this code except misrepresent its origin. 1.7 +# PROVIDED `AS IS' WITH ABSOLUTELY NO WARRANTY OF ANY KIND! 1.8 + 1.9 +DAISY_CHAIN="" 1.10 + 1.11 +for p in $(type -ap chown) ; do 1.12 + if [ ! $p -ef $0 ]; then DAISY_CHAIN=$p ; break ; fi 1.13 +done 1.14 + 1.15 +if [ ! -n "$DAISY_CHAIN" ]; then 1.16 + echo Cannot find real ${0##*/} command 1.17 + exit 1 1.18 +fi 1.19 + 1.20 +if [ $UID == 0 ]; then 1.21 + exec $DAISY_CHAIN "$@" 1.22 +fi 1.23 + 1.24 +# Package users can't chown anything at all, so 1.25 +# having the script test for specific parameters 1.26 +# is pointless. 1.27 +#if [ "$1" == "root.root" ]; then 1.28 + echo 1>&2 '***' chown "$@" 1.29 +#else 1.30 +# $DAISY_CHAIN "$@" || exit $? 1.31 +#fi 1.32 + 1.33 +exit 0