Update bssh.sh

This commit is contained in:
Saige Bowerman 2024-07-02 23:44:49 -05:00
parent 13c8897dcd
commit 0a76e64642
1 changed files with 2 additions and 2 deletions

View File

@ -68,10 +68,10 @@ create_local_configuration() {
if [ "$auth" == "password" ]; then if [ "$auth" == "password" ]; then
read -sp "Enter password: " password read -sp "Enter password: " password
echo "" echo ""
echo -e "host: $host\nport: $port\nusername: $username\nauth: $auth\npassword: $password" > "$CONF_DIR/$username.yml" echo -e "# GENERATED BY bSSH AUTO-CONF\nhost: $host\nport: $port\nusername: $username\nauth: $auth\npassword: $password" > "$CONF_DIR/$username.yml"
elif [ "$auth" == "key" ]; then elif [ "$auth" == "key" ]; then
read -p "Enter path to private key: " key_path read -p "Enter path to private key: " key_path
echo -e "host: $host\nport: $port\nusername: $username\nauth: $auth\nkey: |" > "$CONF_DIR/$username.yml" echo -e "# GENERATED BY bSSH AUTO-CONF\nhost: $host\nport: $port\nusername: $username\nauth: $auth\nkey: |" > "$CONF_DIR/$username.yml"
sed 's/^/ /' "$key_path" >> "$CONF_DIR/$username.yml" sed 's/^/ /' "$key_path" >> "$CONF_DIR/$username.yml"
else else
echo "Unknown authentication method: $auth" echo "Unknown authentication method: $auth"