[SCRIPT] Install f-prot on demand from web for local user
Hi, a new script from me. Only non-interactive/automatic mode for now.
But after installation, you can do a . $HOME/.bashrc or just open a new shell and then run f-prot, run check-updates.sh or man f-prot.
So its fully functional. I think this will be especially great, if used in combination with persistant-home!
So you can have your f-prot together with your home-directory on a usb memory stick and take it everywhere you want, without having to remaster. And you can update f-prots virii-definitions just easily with 'check-updates.sh'. And you have a new f-prot on your mem-stick.
You need to upgrade whole f-prot ?
No problem, just rm -rf $HOME/software/f-prot/ and install it again with this script.
Enjoy! Hope you like that! Comments wanted! Especially from knoppix-doc.sf.net-webmaster. (You can take this script to your documentation of f-prot, it (your doc) gave me the idea, anyway ;-))
cu
Fabian
Code:
#
# Install f-prot - useful in combination with persistant home
#
# GPL
#
# Author: Fabian Franz <[email protected]>
#
mkdir -p $HOME/software/
cd $HOME/software/
wget ftp://ftp.f-prot.com/pub/linux/fp-linux-sb.tar.gz
tar xzf fp-linux-sb.tar.gz
mkdir -p $HOME/man/man8
mkdir -p $HOME/bin
ln -fs $(pwd)/f-prot/f-prot.sh $HOME/bin/f-prot
ln -fs $(pwd)/f-prot/check-updates.sh $HOME/bin/check-updates.sh
ln -fs $(pwd)/f-prot/man8/f-prot.8 $HOME/man/man8/
ln -fs $(pwd)/f-prot/man8/check-updates.sh.8 $HOME/man/man8/
# Setting up Manpath & PATH for f-prot
cp $HOME/.bashrc $HOME/.bashrc.templ
cat $HOME/.bashrc.templ | grep -v "export MANPATH=\$HOME/man" | grep -v "export PATH=\$HOME/bin/"> $HOME/.bashrc
echo "export MANPATH=\$HOME/man/:\$MANPATH" >> $HOME/.bashrc
echo "export PATH=\$HOME/bin/:\$PATH" >> $HOME/.bashrc
rm -f $HOME/.bashrc.templ
# Fix pathes
cp f-prot/f-prot.sh /tmp/f-prot.$$
sed 's%/usr/local/f-prot/%'$(pwd)'/f-prot/%g' /tmp/f-prot.$$ > f-prot/f-prot.sh
cp f-prot/check-updates.sh /tmp/f-prot.$$
sed 's%/usr/local/f-prot/%'$(pwd)'/f-prot/%g' /tmp/f-prot.$$ > f-prot/check-updates.sh
rm -f /tmp/f-prot.$$
# cleanup
rm -f fp-linux-sb.tar.gz
F-Prot auto-scan script! (idea by toast)
Hi!
This script will auto-scan all partitions wiht certain options and put the resulting report into /virus.txt.
Enjoy!
cu
Fabian
Code:
#!/bin/bash
#
# F-Prot Autoscan
#
# GPL
#
# Author: Fabian Franz <[email protected]>
#
# Idea by: Robert Long
#
# Mount all partitions
for i in $(cat /etc/fstab | grep -v "#" | awk '{ print $2}' | egrep "hd|sd"); do sudo mount -o ro $i; done
# Run f-prot
f-prot $(cat /etc/fstab | grep -v "#" | awk '{ print $2}' | egrep "hd|sd") -all -ai -archive -dumb -packed -list -report=/virus.txt
# Unmount them
for i in $(cat /etc/fstab | grep -v "#" | awk '{ print $2}' | egrep "hd|sd"); do sudo umount $i; done
update from Roberto.... Long time no see ...
Thanks to the persistant interest from the users of knoppix and the interest invested into this project by FabianX there has been a script created so that you can install f-prot onto knoppix without having to remaster the disc. unfortunately the script has been outdated a slight bit when frisk Intl. (maker of F-prot) changed the name of the file on their ftp server. the f-prot scripts can be copied from here:
http://www.knoppix.net/forum/viewtop...ighlight=fprot
there is another script on that page that would be wise to check out as it is another wonderful addition.
and it can be run directly from cd as it is a live script.
BUT: in the section where it says:
mkdir -p $HOME/software/
cd $HOME/software/
wget ftp://ftp.f-prot.com/pub/linux/fp-linux-sb.tar.gz
tar xzf fp-linux-sb.tar.gz
that MUST be changed... f-prot changed the ftp filename recently as they restructured their server entries... after being changed it should read:
mkdir -p $HOME/software/
cd $HOME/software/
wget ftp://ftp.f-prot.com/pub/linux/fp-linux-ws.tar.gz
tar xzf fp-linux-ws.tar.gz
and at the end change the following section:
# cleanup
rm -f fp-linux-sb.tar.gz
to read:
# cleanup
rm -f fp-linux-ws.tar.gz
warmest reguards,
roberto (aka toast)
p.s. the edits in final version should look like this:
#!/bin/bash
#
# Install f-prot - useful in combination with persistant home
#
# GPL
#
# Author: Fabian Franz <[email protected]>
#
mkdir -p $HOME/software/
cd $HOME/software/
wget ftp://ftp.f-prot.com/pub/linux/fp-linux-ws.tar.gz
tar xzf fp-linux-ws.tar.gz
mkdir -p $HOME/man/man8
mkdir -p $HOME/bin
ln -fs $(pwd)/f-prot/f-prot.sh $HOME/bin/f-prot
ln -fs $(pwd)/f-prot/check-updates.sh $HOME/bin/check-updates.sh
ln -fs $(pwd)/f-prot/man8/f-prot.8 $HOME/man/man8/
ln -fs $(pwd)/f-prot/man8/check-updates.sh.8 $HOME/man/man8/
# Setting up Manpath & PATH for f-prot
cp $HOME/.bashrc $HOME/.bashrc.templ
cat $HOME/.bashrc.templ | grep -v "export MANPATH=\$HOME/man" | grep -v "export PATH=\$HOME/bin/"> $HOME/.bashrc
echo "export MANPATH=\$HOME/man/:\$MANPATH" >> $HOME/.bashrc
echo "export PATH=\$HOME/bin/:\$PATH" >> $HOME/.bashrc
rm -f $HOME/.bashrc.templ
# Fix pathes
cp f-prot/f-prot.sh /tmp/f-prot.$$
sed 's%/usr/local/f-prot/%'$(pwd)'/f-prot/%g' /tmp/f-prot.$$ > f-prot/f-prot.sh
cp f-prot/check-updates.sh /tmp/f-prot.$$
sed 's%/usr/local/f-prot/%'$(pwd)'/f-prot/%g' /tmp/f-prot.$$ > f-prot/check-updates.sh
rm -f /tmp/f-prot.$$
# cleanup
rm -f fp-linux-ws.tar.gz