Look for SSH

This commit is contained in:
Michael Stanclift 2020-05-30 20:37:59 -05:00
parent d71b901e58
commit 67df5dd266
2 changed files with 24 additions and 13 deletions

View File

@ -15,7 +15,8 @@
- Changelog polarity reversed after heated discussions with marketing team. - Changelog polarity reversed after heated discussions with marketing team.
- Improved method to activate development branch updates, as added in 1.7.2. - Improved method to activate development branch updates, as added in 1.7.2.
- `./gravity-sync.sh dev` will now toggle dev flag on/off. No `touch` required, although it still works that way under the covers. - `./gravity-sync.sh dev` will now toggle dev flag on/off. No `touch` required, although it still works that way under the covers.
- Detects absence of ssh-keygen on host OS and prompts to install (DietPi) - Detects absence of ssh client command on host OS (DietPi)
- Detects absence of ssh-keygen on host OS and will use dropbearkey as an alternative (DietPi)
#### 1.7.3 #### 1.7.3
- Cleaning up output of argument listing - Cleaning up output of argument listing

View File

@ -720,6 +720,8 @@ function intent_validate {
# Configuration Management # Configuration Management
## Generate New Configuration ## Generate New Configuration
function config_generate { function config_generate {
detect_ssh
MESSAGE="Creating ${CONFIG_FILE} from Template" MESSAGE="Creating ${CONFIG_FILE} from Template"
echo_stat echo_stat
cp $HOME/${LOCAL_FOLDR}/${CONFIG_FILE}.example $HOME/${LOCAL_FOLDR}/${CONFIG_FILE} cp $HOME/${LOCAL_FOLDR}/${CONFIG_FILE}.example $HOME/${LOCAL_FOLDR}/${CONFIG_FILE}
@ -849,19 +851,11 @@ function detect_sshkeygen {
echo_info echo_info
KEYGEN_COMMAND="dropbearkey -t rsa -f" KEYGEN_COMMAND="dropbearkey -t rsa -f"
MESSAGE="Installing SSH" MESSAGE="No Alternatives Located"
echo_stat echo_info
distro_check exit_nochange
${PKG_INSTALL} ssh
error_validate
else else
MESSAGE="Installing SSH-KEYGEN"
echo_stat
distro_check
${PKG_INSTALL} ssh-keygen
error_validate
fi fi
fi fi
} }
@ -893,6 +887,22 @@ function distro_check {
fi fi
} }
function detect_ssh {
MESSAGE="Checking for SSH Client on $hostname"
echo_stat
if hash ssh 2>/dev/null
then
echo_good
else
echo_fail
MESSAGE="${PROGRAM} requires SSH be installed"
echo_info
exit_nochange
fi
}
## Delete Existing Configuration ## Delete Existing Configuration
function config_delete { function config_delete {
source $HOME/${LOCAL_FOLDR}/${CONFIG_FILE} source $HOME/${LOCAL_FOLDR}/${CONFIG_FILE}