void

- enter the void 🪐
git clone git://git.acid.vegas/archlinux.git
Log | Files | Refs | Archive

commit d5acee2486857e81ef78a81c9a5b4bbcb5e6ade5
parent 62051da6757bd06813cc0ad08240a3f76e203b81
Author: acidvegas <acid.vegas@acid.vegas>
Date: Tue, 16 Jul 2024 20:28:49 -0400

Renmoved dbc file (moved to new repo)

Diffstat:
Dscripts/dbc | 76----------------------------------------------------------------------------

1 file changed, 0 insertions(+), 76 deletions(-)

diff --git a/scripts/dbc b/scripts/dbc
@@ -1,75 +0,0 @@
-#!/bin/sh
-# Dropbear Connect Script (DBC) - Developed by acidvegas (https://git.acid.vegas/void)
-
-# Dropbear config must be stored in pass in the following format:
-#   NAME USER HOST PORT JUMP
-#
-# JUMP is optional and can be used to specify a host that should use your jump host.
-# If JUMP is set to x, the script will use the jump host to connect to the end host.
-# There should only be one jump host in the config file and it should be named 'jump'.
-#
-# Example:
-#   jump    acidvegas 68.192.37.5   5902
-#   hatebox acidvegas 100.151.45.10 2023 x
-#   aws     admin     45.16.150.203 22
-#
-# Useful commands:
-#   Git usage            : git config core.sshCommand "dbclient -i ~/.ssh/key"
-#   Generate private key : dropbearkey -t ed25519 -f ~/.dropbear/key | grep "ssh-ed25519"
-#   Get public key       : dropbearkey -y -f ~/.dropbear/key | head -n 2 | tail -n 1
-
-load_host() {
-    CONFIG_DATA="$1"
-    NAME="$2"
-
-    # Use grep to find the matching line
-    MATCHING_LINES=$(printf "%s\n" "$CONFIG_DATA" | grep "^$NAME ")
-
-    # Check if exactly one matching line is found
-    LINE_COUNT=$(printf "%s\n" "$MATCHING_LINES" | wc -l)
-    if [ "$LINE_COUNT" -ne 1 ]; then
-        echo "Error: The NAME '$NAME' matches multiple or no lines." && return 1
-    fi
-
-    # Remove extra whitespace from the matching line
-    MATCHING_LINES=$(printf "%s\n" "$MATCHING_LINES" | tr -s '[:space:]' ' ')
-
-    # Read parameters from the matching line
-    line_name=$(echo $MATCHING_LINES | cut -d ' ' -f 1)
-    line_user=$(echo $MATCHING_LINES | cut -d ' ' -f 2)
-    line_host=$(echo $MATCHING_LINES | cut -d ' ' -f 3)
-    line_port=$(echo $MATCHING_LINES | cut -d ' ' -f 4)
-    line_jump=$(echo $MATCHING_LINES | cut -d ' ' -f 5)
-
-    # Output the result
-    printf "%s@%s^%s%s" "$line_user" "$line_host" "$line_port" "$line_jump"
-}
-
-# Check if the name argument is provided
-if [ $# -ne 1 ]; then
-    echo "usage: $0 [name]" && exit 1
-fi
-
-# Read the name argument
-NAME=$1
-
-# Read the config data
-CONFIG_DATA=$($HOME/.scripts/pass dropbear)
-
-# Check if the config data is read successfully
-if [ $? -ne 0 ]; then
-    echo "error: can not read config data" && exit 1
-fi
-
-# Load the host data
-JUMP_HOST=$(load_host "$CONFIG_DATA" "jump")
-END_HOST=$(load_host "$CONFIG_DATA" "$NAME")
-JUMP_CHECK=$(printf "$END_HOST" | rev | cut -c1)
-
-# Connect to the host
-if [ $JUMP_CHECK = "x" ]; then
-    END_HOST=$(printf $END_HOST | rev | cut -c2- | rev)
-    dbclient -K 60 -i $HOME/.dropbear/key $JUMP_HOST,$END_HOST
-else
-    dbclient -K 60 -i $HOME/.dropbear/key $END_HOST
-fi
-\ No newline at end of file