Hi
I am writing a script in Freebsd 4.9 using /bin/sh shell to add and remove
users for an ftp server running proftpd. I have everything working fine and
can add the follwing to proftpd.conf ok. However, the rmuser part removes
everything except the lines added to the conf file for this account. I have
tried using sed to find / replace them but can only manage one line at a
time and some of the lines are in other users accounts. If each accoiunt
has the same lines added with only the $user different, which is passed to
the rmuser code, is there a way of safely finding and deleting a message
block.
If I could find the line number <Anonymous ~$user> appears on and deleted
the range from this line number + 21 for example.
I iknow there are perl scripts etc.. for doing this, but I really want to
learn how to write threse for myself.
Any help appreciated.
Jess
lines added to proftpd.conf
<Anonymous ~$user>
User $user
Group nologin
### Limit the maximum number of anonymous logins
MaxClients 10
### We want 'welcome.msg' displayed at login, and '.message' displayed
### in each newly chdired directory.
DisplayLogin welcome.msg
DisplayFirstChdir .message
RequireValidShell off
AnonRequirePassword on
<Directory /home/$user>
AllowOverwrite on
</Directory>
</Anonymous>