diff --git a/deploy.sh b/deploy.sh index f05e982..fea5078 100644 --- a/deploy.sh +++ b/deploy.sh @@ -1,6 +1,34 @@ #!/usr/bin/env bash + +add_profiled(){ cat < /etc/profile.d/telegram-alert.sh #!/usr/bin/env bash -# Log connection -bash /opt/ssh-login-alert-telegram/alert.sh +# Log connections +bash $ALERTSCRIPT_PATH EOF +} + +add_zsh () { +cat <> /etc/zsh/zshrc + +# Log connections +bash $ALERTSCRIPT_PATH +EOF +} + +ALERTSCRIPT_PATH="/opt/ssh-login-alert-telegram/alert.sh" + +echo "Deploying alerts..." +add_profiled + +echo "Check if ZSH is installed.." + +HAS_ZSH=$(grep -o -m 1 "zsh" /etc/shells) +if [ ! -z $HAS_ZSH ]; then + echo "ZSH is installed, deploy alerts to zshrc" + add_zsh +else + echo "No zsh detected" +fi + +echo "Done!" \ No newline at end of file