#!/bin/sh
# 
# get_policy          
# Sean Boran, 9.4.02
#
# Dump the policy name $policy to a text file for backups and checking.
#

## change the $policy to suit the name of your sunscreen configuration
policy="dmz";

f="./policy.${policy}";

run_cmd () {
    cmd="$*"
    echo ">>>>> Running command: $cmd" >> $f
    ssadm edit dmz <<EOF >>$f
$cmd
EOF
    echo " " >> $f
}


echo "The following is the dmz policy from `uname -n`" > $f
echo " " >> $f

run_cmd "list accesslocal";
run_cmd "list accessremote";
run_cmd "list screen";
run_cmd "list address";
run_cmd "list service";
run_cmd "list rule";
run_cmd "list interface";

ls -l $f


