GithubHelp home page GithubHelp logo

skohscripts / linux_clamav_usb_scan Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 0.0 26 KB

A bash script, which uses the Clamav open-source antivirus engine to scan a folder.

License: MIT License

Shell 100.00%
clamav clamav-antivirus antivirus scan-tool

linux_clamav_usb_scan's Introduction

linux-clamav_usb_scan

support

Un script shell qui utilise ClamAV®, un antivirus open-source, pour détecter les chevaux de Troie, les virus, les malwares et autres menaces.

Une initialisation permet de mettre à jour la base de donnée régulièrement améliorée par la communauté. Le script va ensuite scanner le dossier sélectionner, qui peut être /media/, dans lequel se trouvent les clefs USB et autre disques durs externes.

Pour lancer le script, ne pas oublier d'autoriser l'exécution :
chmod +x ./clamav.sh

Puis se placer dans le dossier et exécuter le script :
./clamav.sh

Et voilà, après tout se fait tout seul. Le résultat du scan sera sauvegardé dans un fichier log log_clamav.txt.

Une prochaine mise à jour permettra de choisir le dossier à scanner.


A shell script that allows to do a complete maintenance of the Linux system (under Ubuntu). Useful

A shell script that uses ClamAV®, an open-source antivirus, to detect Trojans, viruses, malware and other threats.

An initialization is used to update the database regularly enhanced by the community. The script will then scan the selected folder, which could be the /media/ folder, where USB sticks and other external hard drives are located.

To launch the script, don't forget to authorize the execution :
chmod +x ./clamav.sh

Then place yourself in the folder and execute the script:
./clamav.sh

And that's it, then everything is done by itself. The scan result will be saved in a log file log_clamav.txt.

A future update will allow you to choose the folder to scan.

#!/bin/bash

rouge='\e[1;31m'
vert='\e[1;32m'
neutre='\e[0;m'

if [ "$UID" -eq "0" ]
then
    zenity --warning --height 80 --width 400 --title "EREUR" --text "Merci de lancez le script sans sudo : \n<b>./clamav.sh</b>\nVous devrez entrer le mot de passe root par la suite."
    exit
fi

which notify-send > /dev/null
if [ $? = 1 ]
then
	sudo apt install -y libnotify-bin
fi

which zenity > /dev/null
if [ $? = 1 ]
then
	sudo apt install -y zenity
fi

which clamav > /dev/null
if [ $? = 1 ]
then
	sudo apt install -y clamav clamav-daemon
fi

    echo ""
    echo -e -n "$vert [1/2]$rouge MISE A JOUR "
    for i in `seq 20 $COLUMNS`;
        do echo -n "."
    done
    echo -e " $neutre"
    zenity --info --width=300 --height=100 --text "You will be asked to enter your sudo password twice to update the virus database."
    notify-send -i system-software-update "Clamav" "Mises à jour"
    systemctl stop clamav-freshclam
    sudo freshclam
    systemctl start clamav-freshclam
    echo " "

    echo -e -n "$vert [2/2]$rouge SCAN "
    for i in `seq 13 $COLUMNS`;
        do echo -n "."
    done
    echo -e " $neutre"
    echo > log_clamav.txt
    zenity --info --width=300 --height=100 --text "Please select the folder you want to scan."
    notify-send -i system-software-update "Clamav" "Scan"
    inputStr=$(zenity --file-selection --directory "${HOME}")
    clamscan -r --remove --bell --log=log_clamav.txt $inputStr
    echo " "

    notify-send -i dialog-ok "Clamav" "Scan terminé"

linux_clamav_usb_scan's People

Contributors

skohscripts avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.