Page 1 of 5 123 ... LastLast
Results 1 to 10 of 45

Thread: clamscan one-click virus scan

  1. #1

    Default clamscan one-click virus scan

    Suse 11.3 64

    klamav KDE doesn't work. It won't download updates. So, I want to make a one-click scan. I'v been using shell installers from nvidia. I know the sequence I use in the terminal to get it running. There should be way to do this from the desktop.

    Code:
    cd ..
    cd ..
    su
    freshclam
    clamscan -r --exclude-dir=windows --exclude-dir=/sys --exclude-dir=/proc --exclude-dir=/dev
    How do I do that? Thanks.

  2. #2
    Join Date
    Mar 2010
    Location
    Austin - Texas
    Posts
    10,140
    Blog Entries
    48

    Smile Re: clamscan one-click virus scan

    Why not consider writing a bash script file for what you need? Look at my thread called:

    N.S.F. - New Script File Header Creator

    So I ran the command "nsf cs" in the terminal mode and then copy/pasted the information from your message (with modifications) and ended up with an executable script file called cs located in the user ~/bin folder. To use this script without using nsf, don't forget to make the script file executable.

    Code:
    #!/bin/bash
    
    #: Title       : /home/lord_valarian/bin/cs
    #: Date Created: Thu Sep 2 19:27:00 CDT 2010
    #: Last Edit   : Thu Sep 2 19:27:00 CDT 2010
    #: Author      : lord_valarian
    #: Version     : 1.00
    #: Description : Run virus scanning application
    #: Options     : None
    
    
    if [ "$HOME" == "/root" ] ; then
       sudo $0
    fi
    
    cd ..
    cd ..
    freshclam
    clamscan -r --exclude-dir=windows --exclude-dir=/sys --exclude-dir=/proc --exclude-dir=/dev
    
    exit 0
    # End Of Script
    Then to create a shortcut to the script file on the desktop I right clicked on the desktop and selected Create New / Link To Application.Go to the Application Tab and enter the command of cs. Select the advanced button and elect to run in Terminal. Finally Go to the General Tab and changed the name to ClamScan, or anything you like and pick OK. To change the icon, right click on the new desktop icon and pick properties. Select the default icon and make it anything you like as well.

    Now you can run this automated terminal task anytime you want.

    Thank You,
    My Blog: https://forums.opensuse.org/blogs/jdmcdaniel3/

    Software efficiency halves every 18 months, thus compensating for Moore's Law

    Its James again from Austin, Texas

  3. #3

    Default clamscan one-click virus scan

    /bin/clamscan.sh

    I use KDE desktop. I changed it to executable. It's properties read as "shell script". I click on it and nothing happens. There is no "link to application" for right-click on desktop. I can drag a shortcut to the desktop. it to executable. It's properties read as "shell script". I click on it and nothing happens. There is no "link to application" for right-click on desktop. I can drag a shortcut to the desktop. Also, my system has massive slowdown after I click on it. So, I have to force a shutdown. (ctrl-alt-backspace). Sometimes, I have use the power switch on the case for motherboard shutdown.

  4. #4
    Join Date
    Mar 2010
    Location
    Austin - Texas
    Posts
    10,140
    Blog Entries
    48

    Smile Re: clamscan one-click virus scan

    So there are two parts to this. One is to create a usable script and the other is to put it on your desktop. To determine if the script is working, open up a terminal session (like konsole) and type the command:

    clamscan.sh

    Which you indicated is what you called your script file. You should be prompted to enter the root user password and then the script runs as you indicated you did it manually. If this works OK, the next step is to create an icon for it on your desktop. Let me know if part one works before we proceed with part two. If this does not work, then your script is not yet correct.

    Thank You,
    My Blog: https://forums.opensuse.org/blogs/jdmcdaniel3/

    Software efficiency halves every 18 months, thus compensating for Moore's Law

    Its James again from Austin, Texas

  5. #5

    Default clamscan one-click virus scan

    Quote Originally Posted by jdmcdaniel3 View Post
    So there are two parts to this. One is to create a usable script and the other is to put it on your desktop. To determine if the script is working, open up a terminal session (like konsole) and type the command:

    clamscan.sh

    Which you indicated is what you called your script file. You should be prompted to enter the root user password and then the script runs as you indicated you did it manually. If this works OK, the next step is to create an icon for it on your desktop. Let me know if part one works before we proceed with part two. If this does not work, then your script is not yet correct.

    Thank You,
    Code:
    cd bin
    sh clamscan
    
    ERROR: Can't create temporary directory /var/lib/clamav/clamav-b825c126a194c7bec7724a00a438d6aa
    Hint: The database directory must be writable for UID 1000 or GID 100
    ERROR: Can't create temporary directory /var/lib/clamav/clamav-126162c39e65450c198708f17037111a
    Hint: The database directory must be writable for UID 1000 or GID 100
    ERROR: Can't create temporary directory /var/lib/clamav/clamav-dada6fecef11b3df71e5ce5517c50ea5
    Repeats

  6. #6
    Join Date
    Mar 2010
    Location
    Austin - Texas
    Posts
    10,140
    Blog Entries
    48

    Smile Re: clamscan one-click virus scan

    Instead of typing this:

    Code:
    cd bin
    sh clamscan
    Type this instead:

    Code:
    clamscan.sh
    Which you indicated was the name of your script. Also, the ~/bin folder is in your path and so you do not need to change to it.

    Thank You,
    My Blog: https://forums.opensuse.org/blogs/jdmcdaniel3/

    Software efficiency halves every 18 months, thus compensating for Moore's Law

    Its James again from Austin, Texas

  7. #7

    Default Re: clamscan one-click virus scan

    Quote Originally Posted by jdmcdaniel3 View Post
    Instead of typing this:

    Code:
    cd bin
    sh clamscan
    Type this instead:

    Code:
    clamscan.sh
    Which you indicated was the name of your script. Also, the ~/bin folder is in your path and so you do not need to change to it.

    Thank You,
    My scriptname is the same as a command in the script(duh). So, I renamed the file to "scanvirus". Now I get:

    Code:
    > scanvirus
    ERROR: Can't create temporary directory /var/lib/clamav/clamav-54a27b15cf285d81820b744129d5e73c
    Hint: The database directory must be writable for UID 1000 or GID 100
    /lost+found: Can't open directory.
    /bin/pgrep: OK
    /bin/fsync: OK
    /bin/md5sum: OK
    /bin/sed: OK
    continues, no prompt for su password.

  8. #8
    Join Date
    Mar 2010
    Location
    Austin - Texas
    Posts
    10,140
    Blog Entries
    48

    Smile Re: clamscan one-click virus scan

    So, lets change the following line which read:

    Code:
    if [ "$HOME" == "/root" ] ; then
       sudo $0
    fi
    To this new code:

    Code:
    if [ "$HOME" != "/root" ] ; then
       sudo $0
    fi
    and run this in a normal terminal session, not started as root as see what we get.

    Thank You,
    My Blog: https://forums.opensuse.org/blogs/jdmcdaniel3/

    Software efficiency halves every 18 months, thus compensating for Moore's Law

    Its James again from Austin, Texas

  9. #9

    Default clamscan one-click virus scan

    Code:
    #!/bin/bash
    
    #: Title       : /home/lord_valarian/bin/cs
    #: Date Created: Thu Sep 2 19:27:00 CDT 2010
    #: Last Edit   : Thu Sep 2 19:27:00 CDT 2010
    #: Author      : lord_valarian
    #: Version     : 1.00
    #: Description : Run virus scanning application
    #: Options     : None
    
    
    if [ "$HOME" != "/root" ] ; then
       sudo $0
    fi
    
    cd ..
    cd ..
    freshclam
    clamscan -r --exclude-dir=windows --exclude-dir=/sys --exclude-dir=/proc --exclude-dir=/dev
    
    exit 0
    # End Of Script

    It works. Now I need get it so only a super user can alter the script in case someone hacks my user account. Still does nothing when I click on the shell script.

    Also, it seems i'v stumbled onto recursive scripts. Has anyone else used this? Else, i'm the first. For suse techs, this has the potential to be a virus, given what this did to my system. This should be looked into asap.

  10. #10
    Join Date
    Mar 2010
    Location
    Austin - Texas
    Posts
    10,140
    Blog Entries
    48

    Smile Re: clamscan one-click virus scan

    Well, when the script is written right the first time, it can only be run if you know the root user password. When we started, I could not run it myself since I do not have the virus scanner loaded, I made a script logic error and you did not realize the script name should be different from everything else. As for creating an icon on your screen, that will also work, trust me on this. Reread those instructions I gave, knowing the correct name of the script file this time.

    Thank You,
    My Blog: https://forums.opensuse.org/blogs/jdmcdaniel3/

    Software efficiency halves every 18 months, thus compensating for Moore's Law

    Its James again from Austin, Texas

Page 1 of 5 123 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •