-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·41 lines (41 loc) · 1.55 KB
/
install.sh
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
#!/bin/bash
#
# Author: Vladimir Novick , <vlad.novick@gmail.com>
#
# https://www.linkedin.com/in/vladimirnovick
#
# https://github.com/Vladimir-Novick/Monitoring-Memory-Usage
#
# Date: 11.07.2017
# Purpose: check max using memory and create log file
#
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
echo ""
echo " MEMORY MONITOR SERVICE"
echo ""
echo " This is a simple and free tool for monitoring system memory."
echo ""
echo " Service provide periodical check max using memory and create log file"
echo " File: /var/monitor/memory.log"
echo ""
echo -n "Do you want to INSTALL this service (y/n)? "
read answer
if echo "$answer" | grep -iq "^y" ;then
sudo mkdir -p /var/monitor
sudo chmod g+s /var/monitor
sudo cp -rf memory_monitor.py /var/monitor/memory_monitor.py
sudo chmod a+x /var/monitor/memory_monitor.py
sudo cp -rf memory_monitor.service /lib/systemd/system/memory_monitor.service
sudo systemctl daemon-reload
sudo systemctl enable /lib/systemd/system/memory_monitor.service
sudo service memory_monitor start
service memory_monitor status
fi