2 problems.
2 problems.
- Subject: 2 problems.
- From: "D.Walsh" <email@hidden>
- Date: Mon, 3 Jan 2005 00:11:47 -0500
- Mta-interface: amavisd-new-2.2.1 (2004-12-22) at daleenterprise.com
I realize this may be newbie type questions or questions from an
inexperienced programmer but, all that I ask is that you please stop
laughing long enough to provide me with a useable answer that doesn't
include RTFM or go search.
problem #1
I have the following shell script, valid values for VALUE are '-YES-'
or '-NO-'
#!/bin/sh
NAME="MAILTRANSPORT"
VALUE=$1
PATTERN="^$NAME="
HOSTCONFIG=/etc/hostconfig
if [ -z $(grep "$PATTERN" $HOSTCONFIG) ]; then
# create initial entry
echo "$NAME=$VALUE" >> $HOSTCONFIG
else
# replace entry with new value
TMP=$(mktemp /tmp/hostconfig.XXXXXX) || exit 1
grep -v "$PATTERN" $HOSTCONFIG >> $TMP
echo "$NAME=$VALUE" >> $TMP
mv $TMP $HOSTCONFIG
chmod 644 $HOSTCONFIG
chown root:wheel $HOSTCONFIG
fi
I need to duplicate this process in a binary application (made in
XCode) so I'm looking for some source code that does this, do you have
something that can help me?
problem #2
How do I determine if an application/daemon is running, the app/daemon
has a pid and a socket file, if you have some source code for this I'd
appreciate it.
-- Dale
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden