diff --git a/autoremakessh b/autoremakessh index 048706a..490f7e4 100644 --- a/autoremakessh +++ b/autoremakessh @@ -24,11 +24,28 @@ if [[ $1 = "--trigger" ]]; then echo "auto - For automated triggering of autoremakessh" echo "" echo "Possible Options:" - echo "-c [FILE] - Configuration file to use (Default /opt/autoremakessh/client/default)" + echo "-c [FILE] - Configuration file to use (Default /opt/autoremakessh/client/defaultconfig)" echo "-r - Resets .ssh folder of the selected user in the active config" fi +verifydefaultconfigpresence(){ +if [[ -f "$config" = "/opt/autoremakessh/client/defaultconfig" ]]; then + if [ ! -f /opt/autoremakessh/client/defaultconfig ]; then + echo -e ${CR}No default config found!${NF} + return 1 + fi +fi +} + +verifyconfigvalidity(){ +if [ ! -f $config ]; then +echo -e ${CR}Invalid config file location or permissions${NF} +return 1 +fi + +} + guardband() { if [ $? -ne 0 ]; then echo -e "${CR}Script Exited with an Error.${NF}" @@ -52,6 +69,8 @@ checksums(){ if [[ $disablechecksums = "0" ]]; then serversidePUB=$(wget $server/$checksumdir/$priv -q -O -) serversidePRIV=$(wget $server/$checksumdir/$pub -q -O -) + else + echo -e ${CY}Skipping checksum verification${NF} fi }