unix shell script
Posted in 2000
Hello!
I'm trying to install I.Reach on NT. I get to the
place, where release notes says to run certain
script, revoke.sh.
As far as I understand, it's UNIX thing, not NT.
Anybody have idea, what to do with it? I'm not so
strong with scripts. Thanks in advance!
Here it goes:
-------------------------------------------
grant_connect()
{
#arg 1: username
$DBACCESS_CMD << EOF
grant connect to $1;EOF
}
revoke_perms()
{
#arg 1: table_name
#arg 2: username
$DBACCESS_CMD << EOF
grant all on $1 to $2;
revoke alter,delete,insert,update on $1 from $2 ;
revoke ALL on $1 from public;EOF
}
revoke_select()
{
#arg 1: table_name
#arg 2: username
$DBACCESS_CMD << EOF
revoke select on $1 from $2EOF
}
grant_write()
{
#arg 1: table_name
#arg 2: username
$DBACCESS_CMD << EOF
grant insert,delete,update on $1 to $2EOF
}
alter_web_explode_function()
{
$DBACCESS_CMD << EOF
alter function webexplode(html,html) with (modify not
variant);
EOF
}
#MAIN PGM starts here
if [ $# -lt 2 ] ;
then
echo "Usage : $0 < DB Name > < No Privilege User Name
> < APB/DDW Default:APB>"
echo "e.g: $0 ireachdb viewer"
echo "e.g: $0 ireachdb viewer DDW"
exit
fi
IREACH_TABLES="cw_key \\
cw_search_result \\
cw_img_type \\
cw_cont_lck \\
cw_img_act_grp \\
cw_img_iatt \\
cw_iatt_val \\
cw_iattribute \\
cw_pub_doc_ren \\
cw_image \\
cw_pub_frag_blk \\
cw_pub_frag_cont \\
cw_pub_frag_img \\
cw_pub_frag_txt \\
cw_pub_cont \\
cw_pub_chtml \\
cw_pub_shtml \\
cw_pub_fldr \\
cw_pub_url \\
cw_pub_doc \\
cw_pub_contimg \\
cw_pub_scut \\
cw_sub_cont_typ \\
cw_cont_catt \\
cw_catt_val \\
cw_cattribute \\
cw_doc_rend \\
cw_frag_lay_slot \\
cw_frag_slot \\
cw_font \\
cw_color \\
cw_frag_lay \\
cw_frag_blk \\
cw_frag_cont_fmt \\
cw_frag_cont \\
cw_frag_txt \\
cw_frag_img \\
cw_cont_act_grp \\
cw_user_grp \\
cw_group \\
cw_user \\
cw_cont_typ_act \\
cw_act_stat \\
cw_action \\
cw_site \\
cw_status \\
cw_bus_cont_typ \\
cw_cont_typ \\
cw_doc_typ \\
cw_content \\
cw_document \\
cw_contimage \\
cw_shtml \\
cw_url \\
cw_chtml \\
cw_shortcut \\
cw_folder \\
cw_push \\
cw_user_prof \\
cw_user_prof_att \\
cw_configuration \\
cw_hot_pick \\
cw_conf_value \\
cw_titles \\
cw_version \\
cw_content_count \\
cw_frag_count
"
APB_TABLES=" webProjects \\
webObjectTypes \\
webMimeTypes \\
webUsers \\
webPages \\
webPagesVersions \\
webImages \\
webAudios \\
webVideos \\
webDocuments
"
DDW_TABLES="wbProjects \\
wbbinaries \\
wbextensions \\
wbpages \\
wbpreviews \\
wbprojects \\
wbresprojects \\
wbtags
"
if [ "x$3" = "xDDW" ];
then
TABLE_LIST="$IREACH_TABLES $DDW_TABLES"
else
TABLE_LIST="$IREACH_TABLES $APB_TABLES"
fi
DBACCESS_CMD="$INFORMIXDIR/bin/dbaccess $1"
#DBACCESS_CMD="cat"
export DBACCESS_CMD
# allow user to connect to database
grant_connect $2
# revoke all for this user
for i in `echo $TABLE_LIST`
do
revoke_perms $i $2
done
revoke_select cw_user $2
#for reader side inserts, "subscriber" feature.
grant_write cw_user_prof $2
grant_write cw_user_prof_att $2
#need to alter the webexplode() function
alter_web_explode_function
__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com