Created
January 28, 2018 16:56
Revisions
-
Ketrel created this gist
Jan 28, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,34 @@ #!/bin/sh e="\033" clu(){ if [ ! -z ${1} ] && [ $(tput colors) -ge 8 ]; then printf "${e}[${1}m" fi } prog="" default="server" pathmod="/local" if [ -z ${1} ]; then printf -- "---$(clu '41;1') %b $(clu 0)---\n" "Invalid Use Of Script" exit 1 fi #-------------------# if [ "${1}" = "local" ] || [ "${1}" = "remote" ]; then prog="${default}" pathmod="/${1}" else prog="${1}" fi #-------------------# if [ ! -z ${2} ] && ([ "${2}" = "local" ] || [ "${2}" = "remote" ]); then pathmod="/${2}" elif [ ! -z ${2} ]; then printf -- "---$(clu '41;1') %b $(clu 0)---\n" "Invalid Use Of Script" exit 1 fi #-------------------# if [ -f "$HOME/Scripts/sshcon_scripts${pathmod}/${prog}" ]; then . "$HOME/Scripts/sshcon_scripts$pathmod/${prog}" else printf -- "---$(clu '41;1') %b $(clu 0)---\n" "Specified Connection Command Invalid" fi