Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Stuck with bash script

Hey guys,

so i'm creating a script that automates the creation of a website & adding a ftp user & mysql user.
The problem i'm having is whenever i pass the password to the docker container, the password will never be fully in the config file.
example: https://gyazo.com/1f1ad56c59e98ce833e99ab75656440d

How can i make the script ignore all the $ symbols in the password to make it work?
Its probably not the best way to do it but heres what i got to create it

Code
    pass=$(openssl passwd -1 ${password})
    docker exec ftp-server sh -c "echo ${user,,}:\\${pass} >> /conf/vsftpd/virtual_users"

It ignores the first $, but not the other ones.

I hope that someone can help me out.

Thanks
[Image: voZ00gr.gif]
The problem could be in "\\$" as it forces to always print "\$" as symbols.
(Apr 24, 2018 05:27 AM)archangel.dmitry Wrote:  The problem could be in "\\$" as it forces to always print "\$" as symbols.

Even if i remove the \\ i still have the same problem, it then even gives empty passwords
[Image: voZ00gr.gif]
Make sure you assign user variable.


Possibly Related Threads...
Thread / Author Replies Views Last Post
by IrritiableNov 14, 2021 10:25 AM 7 249 Nov 14, 2021 10:25 AM
Last Post: Exalted
by hack3rconJun 8, 2019 11:20 PM 10 217 Jun 8, 2019 11:20 PM
Last Post: hack3rcon
[Debian] by KoutaJun 28, 2018 02:12 PM 3 174 Jun 28, 2018 02:12 PM
Last Post: Kouta