nsm_server_backup-config automation

已查看 46 次
跳至第一个未读帖子

Jason

未读,
2014年7月20日 13:26:412014/7/20
收件人 securit...@googlegroups.com
Hello,

In my efforts to automate this script for DR and change management I ran into trouble with the "-y" and "--force-yes" options. nothing worked, until.

What I have done to make this work is modify the /usr/sbin/nsm_server_backup-config file.

the line I modified to make things work is line # 170;
I changed
if [ "$PROMPT_RET" != "Y" -a "PROMPT_RET" != "y" ]
to
if [ "$PROMPT_RET" != "N" -a "PROMPT_RET" != "n" ]
and everything seams to work as expected now.

Is this a sound change, or might I cause other issues by doing this?

Many thanks in advance for any feedback,
Jason

Doug Burks

未读,
2014年7月22日 08:41:312014/7/22
收件人 securit...@googlegroups.com
Hi Jason,

It looks like the "-y" and "--force-yes" options set a variable called
FORCE_YES:

"-y" | "--force-yes")
FORCE_YES=yes

But it looks like that variable is never checked before prompting the user:

# prompt to backup the configuration
prompt_user_yesno "Backup Server Configuration" "All configurations
for server \"$SERVER_NAME\" will be backed up to:\n$BACKUP_FILE\n\nDo
you want to continue?" "N"
[ "$?" -ne 0 ] && exit 1
if [ "$PROMPT_RET" != "Y" -a "$PROMPT_RET" != "y" ]
then
exit 1
fi

So I think the proper way to fix this is to add a check for FORCE_YES
that would avoid prompting the user.

I've created Issue 561 to work on this:
https://code.google.com/p/security-onion/issues/detail?id=561

and added it to the Roadmap:
https://code.google.com/p/security-onion/wiki/Roadmap
> --
> You received this message because you are subscribed to the Google Groups "security-onion" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to security-onio...@googlegroups.com.
> To post to this group, send email to securit...@googlegroups.com.
> Visit this group at http://groups.google.com/group/security-onion.
> For more options, visit https://groups.google.com/d/optout.



--
Doug Burks
http://securityonionsolutions.com
回复全部
回复作者
转发
0 个新帖子