Page 1 of 1

Manually remove contact

Posted: Thu Oct 27, 2022 9:01 am
by christopher.thompson
I have an old employee that's been removed from the contacts, now when I try to commit changes it spits errors as a result of their username being referenced in host cfg files. How do I best remove the username from all files in order to apply the configuration

Re: Manually remove contact

Posted: Thu Oct 27, 2022 6:42 pm
by lazzarinof
When I had this issue, I used sed to delete the contact:

For the area in quotes: the s indicates a string, then a slash. After the slash is the string to be deleted/replaced, then another slash. Then the string to replace (leave blank to just delete the first string. Then a slash. Then a lowercase g, indicating to delete/replace all instances:
sed -i 's/string to be deleted or replaced here/string to replace with, or leave blank to just delete/g' /usr/example/directory//*

But I'd always hesitate extreme caution when manually editing the config files.