Richard G
Verified User
I'm no scripter so I don't know how to do this because of the RET and exit in here.
I want to add this code:
But there is already an existing user_create_post script with this content:
So there is also an exit 0 in there.
And it the part I want to add is the RET=$? which returns after that exit.
I presume that an exit will kill the script and not the command. So I would like to know how to add the above code first in the correct way.
I want to add this code:
Code:
#!/bin/sh
/usr/sbin/usermod -a -G noperl $username 2>&1
RET=$?
exit $RET
But there is already an existing user_create_post script with this content:
Code:
#!/bin/sh
if [ "$spam" = "ON" ]; then
DIR=/home/$username/.spamassassin
mkdir $DIR
cp -f /root/antispam/user_prefs $DIR/user_prefs
chown ${username}:mail $DIR
chmod 771 $DIR
chown $username:$username $DIR/user_prefs
chmod 755 $DIR/user_prefs
touch $DIR/spam
chown mail:$username $DIR/spam
chmod 660 $DIR/spam
fi
exit 0;
So there is also an exit 0 in there.
And it the part I want to add is the RET=$? which returns after that exit.
I presume that an exit will kill the script and not the command. So I would like to know how to add the above code first in the correct way.