Get your server issues fixed by our experts for a price starting at just 25 USD/Hour. Click here to register and open a ticket with us now!

Author Topic: Python script to install rkhunter and clamav  (Read 1189 times)

0 Members and 1 Guest are viewing this topic.

vichithrakumart

  • Guest
Python script to install rkhunter and clamav
« on: February 15, 2018, 08:35:08 pm »
Note: If any dependency error occurred during installation, please fix it.

Script:
#!/usr/bin/env python
#Scipt to install rkhunter and clamav
#Written By Vichithrakumar T Sys-admin Trainee Admin-ahead Server Technologies
import sys
import subprocess
import os
rkopt = raw_input("Do you want to install and update rkhunter (yes/no):")
if rkopt == 'yes':
        print "RK Hunter Installation......"
        subprocess.call(["yum","install","rkhunter","-y"])
        subprocess.call(["rkhunter","--update"])
clopt = raw_input("Do you want to install and update clamav (yes/no):")
if clopt == 'yes':
        subprocess.call(["rm", "-rf", "/root/clamav"])
        subprocess.call(["mkdir", "/root/clamav"])
        os.chdir("/root/clamav")
        subprocess.call(["wget","http://www.clamav.net/downloads/production/clamav-0.99.2.tar.gz","-P","/root/clamav"])
        os.chdir("/root/clamav")
        p = subprocess.Popen(["tar","-xvf","clamav-0.99.2.tar.gz"], cwd = "/root/clamav")
        p.wait()
        os.chdir("/root/clamav/clamav-0.99.2")
        subprocess.call(["./configure"])
        subprocess.call(["make"])
        subprocess.call(["make","install"])
        subprocess.call(["ldconfig"])