have you tried
???
edit:
note to self:
try to be more helpful even if op provided no info at all.
ok, we need to know your operating system.
the shutdown command is likely a good choice, but you will have to read its man page first and maybe apply a few options:
edit2:
i literally answered your question, but i suspect you want to somehow automate the process.
how about a simple shell script with an if-then statement?
if interface down; then shutdown
i think you can use the 'ip' command to check if an interface is up or down. but there's probably a dozen other options.