Skip to main content

Hello the community !

Recently you helped me on the ‘Massive import’ topic, by the usage of a script to execute many changes on one action. I’ve used this solution and it works fine.

I would like to improve the last line :

/usr/share/centreon/script/delete_device_from_hostgroup.sh <user> <password> <hostgroup> <file>

My objective is to hide <password>, for obvious security reasons. I’ve tried to use .bashrc file with an alias, but it didn’t work.

Do you have an idea to improve this ?

Thanks !

Hello Pierre


Is it the same contact/user you’re using each time you execute the script?

If yes, is it possible for you to do it directly into the script and not in the parameters.


Hello sduret, yes it’s the same user. It’s a good idea, I’ll test it next monday.

 

Thanks,


My way of handling it with a script that is launched manually:

read -s PASSWORD
<type your password + ENTER (it won't be displayed)>
/usr/share/centreon/script/delete_device_from_hostgroup.sh <user> "$PASSWORD" <hostgroup> <file>

 


Thanks omercier, yes it works fine, the password is hidden, and I don’t have to add it on each script.

I’ll apply this solution.


Reply