2014-06-04 18:13:59 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
#
|
|
|
|
# Import/export EasyRSA default settings
|
|
|
|
#
|
|
|
|
|
2015-02-28 10:45:31 +00:00
|
|
|
if [ "$DEBUG" == "1" ]; then
|
|
|
|
set -x
|
|
|
|
fi
|
|
|
|
|
|
|
|
set -e
|
2014-06-04 18:13:59 +00:00
|
|
|
|
|
|
|
if [ $# -lt 1 ]; then
|
|
|
|
echo "No command provided"
|
|
|
|
echo
|
|
|
|
echo "$0 export > /path/to/file"
|
|
|
|
echo "$0 import < /path/to/file"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
cmd=$1
|
|
|
|
shift
|
|
|
|
|
|
|
|
case "$cmd" in
|
|
|
|
export)
|
|
|
|
if [ -f "$EASYRSA_VARS_FILE" ]; then
|
|
|
|
cat "$EASYRSA_VARS_FILE"
|
|
|
|
else
|
|
|
|
cat "$EASYRSA/vars.example"
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
import)
|
|
|
|
cat > "$EASYRSA_VARS_FILE"
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "Unknown cmd \"$cmd\""
|
|
|
|
exit 2
|
|
|
|
;;
|
|
|
|
esac
|