Using non conf commands in vbash script

Hello,

I’m writing some automation for Vyos and trying to use the restart command in the vbash script. I get an Invalid command: [restart] error. Haven’t found the fix yet, prob missing something simple.

thanks for any help pointing me in the write direction

please share your script

Here it is:

#!/bin/vbash
source /opt/vyatta/etc/functions/script-template

curl https://rules.emergingthreats.net/open/suricata-6/emerging.rules.tar.gz --output /home/vyos/rules.tar.gz

# Path to the rules.tar.gz file
RULES_ARCHIVE="/home/vyos/rules.tar.gz"

# Directory where rules should be extracted
RULES_DIR="/config/suricata/rules/rules"

# Extract the rules.tar.gz file
tar -xvzf "$RULES_ARCHIVE" -C "$RULES_DIR" --overwrite

# Optional: Restart Suricata
restart container suricata

Try using run restart container suricata
Docs: Command Scripting — VyOS 1.5.x (circinus) documentation

2 Likes

Thanks, completely overlooked that.