Tag Archives: DH

Simple shell script mechanic help

By arfett

A good while back I made a script to configure ipsec tunnels and I haven’t touched shell scripting in quite some time and need help figuring out what something does here…

Code:

# setup esp DH group
[ "$espdh" = "none" ] && espdh="" || espdh="-$espdh"

# setup ike and esp strict mode
[ "$ikestrict" = "yes" ] && ikestrict="!" || ikestrict=""
[ "$espstrict" = "yes" ] && espstrict="!" || espstrict=""


I forgot in “espdh=”-$espdh”” what the minus sign in front of the variable is doing.

Seems like a slightly stupid question I would be able to figure out on google but my googling skills don’t seem to find anything relevant.

Source: FULL ARTICLE at The UNIX and Linux Forums