home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OpenStep 4.2
/
Openstep-4.2-Intel-User.iso
/
usr
/
lib
/
NextStep
/
loginwindow.app
/
writeDefaults4.sh
< prev
Wrap
Linux/UNIX/POSIX Shell Script
|
1996-04-04
|
604b
|
31 lines
#!/bin/sh
BASENAME=`basename $0`
if [ $# != 2 ]; then
echo "usage: $BASENAME <username> <listfile>"
exit 1
fi
DEFAULTSCMD=/usr/bin/defaults
USERNAME=$1
DEFAULTSLIST=$2
TMPFILE=/tmp/$BASENAME.$$
if [ -f $DEFAULTSCMD ]; then
if [ -f $DEFAULTSLIST ]; then
if [ "`/usr/ucb/whoami`" = "root" ]; then
grep -v "^#" $DEFAULTSLIST | sed "s/^/\/usr\/bin\/defaults write /" > $TMPFILE
su $USERNAME < $TMPFILE
rm -f $TMPFILE
else
echo "$BASENAME must be run as root."
exit 1
fi
else
echo "Missing `basename $DEFAULTSLIST`."
exit 1
fi
else
exit 0 # The system is not NeXTSTEP 4.x
fi