0% found this document useful (0 votes)
27 views1 page

Cleanup Linux SH

Uploaded by

alex26libra
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views1 page

Cleanup Linux SH

Uploaded by

alex26libra
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

#!

/bin/bash
export PATH=$PATH:/sbin:/usr/sbin:/bin:/usr/bin
base=`dirname "$0"`
echo "begin cleanup linux..." >> "$base/forticlientsslvpn.log"
if [ -f "$base/resolv.conf.backup" ]; then
echo "restore /etc/resolv.conf" >> "$base/forticlientsslvpn.log"
mv -f "$base/resolv.conf.backup" /etc/resolv.conf
fi
echo "clean up route..." >> "$base/forticlientsslvpn.log"
if [ -f "$base/forticlientsslvpn.cleanup.tmp" ]; then
source "$base/forticlientsslvpn.cleanup.tmp"
rm -f "$base/forticlientsslvpn.cleanup.tmp"
fi
if [ -f "$base/pppd.log" ]; then
echo "truncate pppd.log" >> "$base/forticlientsslvpn.log"
tlog=`tail -n 300 "$base/pppd.log"`
echo "$tlog" > "$base/pppd.log"
fi
if [ -f "$base/forticlientsslvpn.log" ]; then
echo "truncate forticlientsslvpn.log" >> "$base/forticlientsslvpn.log"
tlog=`tail -n 30000 "$base/forticlientsslvpn.log"`
echo "$tlog" > "$base/forticlientsslvpn.log"
fi

You might also like