-for i in $(ls /etc/invirt/vnc-cert.d/*.crt); do
- keytool -noprompt -alias "${i%.crt}" -file "/etc/invirt/vnc-cert.d/$i" \
- -keystore "$TMP_DIR/trust.store" -storepass "foobar"
+for i in /etc/invirt/vnc-cert.d/*.crt; do
+ keytool -import -noprompt -alias "$(basename "${i%.crt}")" -file \
+ "$i" -keystore "$TMP_DIR/trust.store" -storepass "foobar"