#!/bin/bash

DATE=$(date +%Y%d%m)

rbacFile="/tmp/rbacInfo$DATE.txt"

echo 'Getting user info...'
echo "########### USER DATA #################" > $rbacFile
/usr/local/omk/bin/oprbac_admin.exe act=list-users verbose=1 >> $rbacFile
echo 'Getting role info...'
echo "" >> $rbacFile
echo "########### ROLE DATA #################" >> $rbacFile
/usr/local/omk/bin/oprbac_admin.exe act=list-roles verbose=1 >> $rbacFile
echo 'Getting privilege info...'
echo "" >> $rbacFile
echo "########### PRIV DATA #################" >> $rbacFile
/usr/local/omk/bin/oprbac_admin.exe act=list-privs verbose=1 >> $rbacFile
echo 'Getting object info...'
echo "" >> $rbacFile
echo "########### OBJECT DATA #################" >> $rbacFile
/usr/local/omk/bin/oprbac_admin.exe act=list-objects verbose=1 >> $rbacFile
echo ""
echo "Please send $rbacFile to support@opmantek.com.  Thanks!"
echo ""

