forked from happycodinguk/telegram-system-monitor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcsf-inst.txt
51 lines (30 loc) · 1.19 KB
/
csf-inst.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
read -p "
-------------------------------------
### Install CSF/LFD Notifications ###
-------------------------------------
You will need to enable the relevant notifications in your CSF config file!
ie: LF_SSH_EMAIL_ALERT etc.
If these aren't enabled, the log file won't have log entries to send via telegram.
Are you ready?
Yes or No?" -n 1 -r
echo # (optional) move to a new line
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
exit 1
fi
# Inserts chosen install directory into sytemd service
sed -i 's|"YOUR_INSTALL_DIR"|'"$inspath"'|g' csf-lfd-alert.service
### Move downloaded files to your chosen directory ##################
mv -i csf-lfd-notifications.sh /$inspath
### Move Systemd files into system folder ##########################
mv -i csf-lfd-alert.service /etc/systemd/system/
### Setting file permissions ########################################
chmod 700 /$inspath/csf-lfd-notifications.sh
chmod 644 /etc/systemd/system/csf-lfd-alert.service
# Setting Up SYSTEMD Job for hard disk alarm!
systemctl enable csf-lfd-alert.service
# Reload systemd
systemctl daemon-reload
systemctl start csf-lfd-alert.service
# Status
systemctl status --no-pager csf-lfd-alert.service