forked from Nikotecnology/ServerAccessLogging
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
25 lines (17 loc) · 889 Bytes
/
Copy pathinstall.sh
File metadata and controls
25 lines (17 loc) · 889 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash
#Adding permission to the telegram-send script and copying it to the executable's folder
chmod +x telegram-send.sh
sudo cp telegram-send.sh /usr/bin/telegram-send
sudo chown root:root /usr/bin/telegram-send
mkdir -p /var/serveraccesslogging
if ! test -f "/var/serveraccesslogging/.env.local"; then
sudo cp .env /var/serveraccesslogging/.env.local
fi
if ! test -f "/var/serveraccesslogging/message.txt"; then
sudo cp message.txt /var/serveraccesslogging/message.txt
fi
sudo cp bot.py /var/serveraccesslogging/bot.py
#Copying notify script into the profile.d folder to make it execute on login
sudo cp access-notify.sh /etc/profile.d/access-notify.sh
sudo cp var.py /etc/profile.d/var.py
echo "Completed! Now the file .env.local is in this folder: /var/serveraccesslogging/.env.local, and you can customize the message in the same folder but in the file message.txt"