more polish
This commit is contained in:
@@ -173,27 +173,26 @@ EOF
|
||||
}
|
||||
|
||||
if [[ ! -e $cfg_path ]]; then
|
||||
prompt_user "sshd config" "Do you want to configure sshd?"
|
||||
prompt_user "sshd" "Currently unconfigured for certs. Do you want to configure?"
|
||||
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
||||
install_cert_config
|
||||
update_prompt $GREEN_CHECK "Configured sshd"
|
||||
update_prompt $GREEN_CHECK "sshd" "Configured to use and accept certs"
|
||||
fi
|
||||
fi
|
||||
|
||||
restart_sshd
|
||||
echo
|
||||
}
|
||||
|
||||
restart_sshd() {
|
||||
if ! systemctl is-active --quiet sshd; then
|
||||
prompt_user "sshd.service" "sshd.service is not active. Restart?"
|
||||
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
||||
echo -en "$YELLOW_BANG Restarting sshd..."
|
||||
systemctl restart sshd
|
||||
if [[ $? -eq 0 ]]; then
|
||||
local sshd_pid=$(systemctl show --property MainPID --value sshd)
|
||||
update_prompt $GREEN_CHECK "Restarted sshd.service on PID: $sshd_pid"
|
||||
fi
|
||||
update_prompt $GREEN_CHECK "sshd" "Restarted sshd.service on PID: $sshd_pid"
|
||||
else
|
||||
local sshd_pid=$(systemctl show --property MainPID --value sshd)
|
||||
echo -e "$GREEN_CHECK sshd.service is active on PID: $sshd_pid"
|
||||
update_prompt $RED_X "sshd" "Failed to restart sshd.service"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user