Product Support | Talos Support | Cisco Support | Reference + | Current Release |
---|---|---|---|---|
Gateway | Reputation Lookup | Open a support case | Secure Email Guided Setup | |
Cloud Gateway | Email Status Portal | Support & Downloads | docs.ces.cisco.com | |
Email and Web Manager | Web & Email Reputation | Worldwide Contacts | Product Naming Quick Reference | |
Encryption | Bug Search | |||
Cloud Mailbox | Notification Service |
Hello,
I am writing a script to automate the blocking of malicious senders on my IronPort, but I have some questions about how to execute a sequence of commands. I have a Linux server that connects via SSH but I am not able to execute all commands after connecting to the CLI.
I did some tests, but they all showed the same error as if it only identified one command.
Examples:
ssh user@$server "dictconfig" "edit" "7" "new" "teste.com"
ssh user@$server
"dictconfig"
"edit"
"7"
"new"
"teste.com"
How can I solve this problem?
Best Regards
Solved! Go to Solution.
You can solve the problem this way:
ssh user@server.com "dictionaryconfig edit List new $domain; commit -y"
I will create a repository on github as soon as possible. I am working on some script improvements now.
I am using version 12 on my IronPort. Could you give me some example of how you could execute a command sequence via script?
I need to automate the steps below:
ironportr> dictionaryconfig
Currently configured content dictionaries:
7. Suspect
Choose the operation you want to perform:
- NEW - Create a new content dictionary.
- EDIT - Modify a content dictionary.
- DELETE - Remove a content dictionary.
- RENAME - Change the name of a content dictionary.
[]> edit
Enter the number of the dictionary you want to edit:
7. Suspeito
[]> 7
Choose the operation you want to perform on dictionary 'Suspeito':
- NEW - Create new entries in this dictionary.
- IMPORT - Replace all of the words in this dictionary.
- EXPORT - Export the words in this dictionary.
- DELETE - Remove an entry in this dictionary.
- PRINT - List the entries in this dictionary.
- SETTINGS - Change settings for this dictionary.
[]> new
teste.com
Thanks for your help Mathew Huynh,
I was able to perform the action with the command “dictionaryconfig edit Suspect new emxample.com”, but as I do to “commit” on the same line as excerpt from the script below:
blockEmail () {
ssh user @ ironport "dictionaryconfig edit Suspicious new exwemple.com"
}
SSH login already occurs without the use of password because I already set the access key.
You can solve the problem this way:
ssh user@server.com "dictionaryconfig edit List new $domain; commit -y"
I will create a repository on github as soon as possible. I am working on some script improvements now.
I tried a similar approach with textconfig for automating text resources creation here, but couldn't get it to work for some reason.