We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 20d855d commit 659d325Copy full SHA for 659d325
deploy.sh
@@ -1,6 +1,34 @@
1
#!/usr/bin/env bash
2
+
3
+add_profiled(){
4
cat <<EOF > /etc/profile.d/telegram-alert.sh
5
-# Log connection
-bash /opt/ssh-login-alert-telegram/alert.sh
6
+# Log connections
7
+bash $ALERTSCRIPT_PATH
8
EOF
9
+}
10
11
+add_zsh () {
12
+cat <<EOF >> /etc/zsh/zshrc
13
14
15
16
+EOF
17
18
19
+ALERTSCRIPT_PATH="/opt/ssh-login-alert-telegram/alert.sh"
20
21
+echo "Deploying alerts..."
22
+add_profiled
23
24
+echo "Check if ZSH is installed.."
25
26
+HAS_ZSH=$(grep -o -m 1 "zsh" /etc/shells)
27
+if [ ! -z $HAS_ZSH ]; then
28
+ echo "ZSH is installed, deploy alerts to zshrc"
29
+ add_zsh
30
+else
31
+ echo "No zsh detected"
32
+fi
33
34
+echo "Done!"
0 commit comments