diff --git a/main.sh b/main.sh index 03ebb2d3..8a8f9c9c 100644 --- a/main.sh +++ b/main.sh @@ -20,6 +20,10 @@ case "$1" in source $manageConfigPath/src/aws/load.sh driver "${@:2}" ;; + sshConfigManager) + source $manageConfigPath/src/utils/load.sh + driver "${@:2}" + ;; *) echo "Error: Invalid command." usage diff --git a/src/utils/callUpdate.sh b/src/utils/callUpdate.sh index 1859c5ed..c757000f 100644 --- a/src/utils/callUpdate.sh +++ b/src/utils/callUpdate.sh @@ -63,8 +63,8 @@ function update(){ esac - update_ssh_config "$host" "$HostName" "$User" "$Port" "$IdentityFile" "$RemoteForward" + updateSshConfig "$host" "$HostName" "$User" "$Port" "$IdentityFile" "$RemoteForward" } -update $host "RemoteForward" "8888:80" "8887:81" \ No newline at end of file +#update $host "RemoteForward" "8888:80" "8887:81" \ No newline at end of file diff --git a/src/utils/create.sh b/src/utils/create.sh index aaca6010..48a9c51d 100644 --- a/src/utils/create.sh +++ b/src/utils/create.sh @@ -1,5 +1,5 @@ -create_ssh_config() { +createSshConfig() { HOST_NAME="$1" HOST_ENTRY=$(cat < [options]" @@ -22,13 +21,13 @@ function driver() { # Execute the appropriate command case "$1" in create) - create "${@:2}" + createSshConfig "${@:2}" ;; update) - callUpdate "${@:2}" + update "${@:2}" ;; delete) - delete "${@:2}" + deleteSshConfig "${@:2}" ;; *) echo "Error: Invalid command." diff --git a/src/utils/load.sh b/src/utils/load.sh index 5eada01f..f672337f 100644 --- a/src/utils/load.sh +++ b/src/utils/load.sh @@ -1,11 +1,11 @@ -manageConfigPath=$(pwd) -source $manageConfigPath/dependencies/config.sh -source $manageConfigPath/dependencies/array.sh -source $manageConfigPath/dependencies/read.sh -source $manageConfigPath/dependencies/replace.sh -source $manageConfigPath/dependencies/retrieve.sh +source $manageConfigPath/src/utils/dependencies/config.sh +source $manageConfigPath/src/utils/dependencies/array.sh +source $manageConfigPath/src/utils/dependencies/read.sh +source $manageConfigPath/src/utils/dependencies/replace.sh +source $manageConfigPath/src/utils/dependencies/retrieve.sh -source $manageConfigPath/create.sh -source $manageConfigPath/update.sh -source $manageConfigPath/delete.sh -source $manageConfigPath/callUpdate.sh +source $manageConfigPath/src/utils/create.sh +source $manageConfigPath/src/utils/update.sh +source $manageConfigPath/src/utils/delete.sh +source $manageConfigPath/src/utils/callUpdate.sh +source $manageConfigPath/src/utils/driver.sh diff --git a/src/utils/update.sh b/src/utils/update.sh index 4a36e1f0..c2e868cd 100644 --- a/src/utils/update.sh +++ b/src/utils/update.sh @@ -1,4 +1,4 @@ -update_ssh_config() { +updateSshConfig() { HOST_NAME="$1" TEMP_FILE=$(mktemp) @@ -11,6 +11,6 @@ update_ssh_config() { !skip {print} ' $CONFIG > "$TEMP_FILE" && mv "$TEMP_FILE" $CONFIG - create_ssh_config "$@" + createSshConfig "$@" echo "Configuration for $HOST_NAME updated." }