Hey,
ich wollte mal fragen, ob es möglich ist mit Bash eine Seite auf zu rufen und daraus Werte zu speichern. Feste Werte. Hintergrund: ViMbAdmin, beim ersten aufruf muss man ja Manuel arbeiten:
1 2 3 4 5 6 7 8 9 10 | Step 1: Security Salts Security salts are used to ensure your passwords are secure, you are authorised to complete the install procedure and for cookie security. To proceed, please set the following randomly generated salts at the top of the [user] section of the following file: application/configs/application.ini. securitysalt = "\K?OjZ;5JFZTqEUG#%o3@T-py92@tx2>n0u60pkg7;b_x/oE+Md]4wkfW&4*CC|B" resources.auth.oss.rememberme.salt = ">o(%!{H9:B}7A+0liAw#ME;BEx;Qb]r25$jg:yPaVcu1u]Jx%m-.vR3JIk5t/&\{" defaults.mailbox.password_salt = "?ZN]Wc*IVnf#DJ/+%.MfLqzUw2zY~6{JewO($,L]1aeMH4\x/9$qcg@EY{&(Gu4>" Please also ensure you have set all the appropriate values in the [user] section before continuing. |
Diese Werte würde ich gern irgendwie automatisiert eintragen.
Ich habe mich mal versucht mit dem folgenden Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | PATH_TO_VMA_SALTS="/root/vma.txt" wget "http://${MYDOMAIN}/vma/auth/setup" -O vma.txt VMA_SECURITY_SALT=$(grep -Pom 1 "(?<=^securitysalt = ).*$" $PATH_TO_VMA_SALTS) VMA_REMEMBERME_SALT=$(grep -Pom 1 "(?<=^resources.auth.oss.rememberme.salt = ).*$" $PATH_TO_VMA_SALTS) MAILBOX_PASSWORD_SALT=$(grep -Pom 1 "(?<=^defaults.mailbox.password_salt = ).*$" $PATH_TO_VMA_SALTS) echo $VMA_SECURITY_SALT echo "-----------------------" echo $VMA_REMEMBERME_SALT echo "-----------------------" echo $MAILBOX_PASSWORD_SALT echo "-----------------------" |
vma.txt:
</p>
<pre>securitysalt = ">Tyb;lf.=k{f4h%?2qGi$Ca4ASLMsx~3X/R#/U@M_HLbj5X7IzuO,y_T!W+n\E*;"
resources.auth.oss.rememberme.salt = "6J5)yL##,(<UoqNVY{lI2Rb}^@Q4+>7_:>3-VI0T_P(XFsGe}RqO6ZLuxP/pN8~?"
defaults.mailbox.password_salt = "P&~t*98hv6H7|l7HDO(=ex+d<])|j.}{q44Q?nD-/<u(CS%jF;.zcKf^$yd~r6>i"</pre>
<p>
Allerdings stimmt die Ausgabe noch nicht ganz. Der securitysalt klappt gar nicht. der rememberme salt geht, da muss ich noch "" entfernen. Das wollte ich über ne pipe per SED machen.
Genauso bei mailbox salt
Aber ich weiß nicht, wieso der security Salt nicht funktioniert.
root@testserver:~# bash testvma.sh
VMA_SECURITY_SALT
-----------------------
VMA_REMEMBERME_SALT
"6J5)yL##,(<UoqNVY{lI2Rb}^@Q4+>7_:>3-VI0T_P(XFsGe}RqO6ZLuxP/pN8~?"
-----------------------
MAILBOX_PASSWORD_SALT
"P&~t*98hv6H7|l7HDO(=ex+d<])|j.}{q44Q?nD-/<u(CS%jF;.zcKf^$yd~r6>i"</pre>
-----------------------
root@testserver:~#
Wiedermal: Vielen dank für eure Hilfe ☺