jablonka.czprosek.czf

hotsanic

Subversion Repositories:
[/] [trunk/] [modules/] [part/] [setup] - Blame information for rev 36

 

Line No. Rev Author Line
11simandl#!/usr/bin/env sh
2 
3if ! [ -e settings ]; then OUTFILE="settings"; else OUTFILE="settings.new"; fi
4 
5 
6cat > $OUTFILE << EOF
7# You may configure partitions you would like to monitor.
8# multiple lines are of course allowed.
9#
10# for a local drive enter:
11# DRIVE=<device>,<description>
12#
13# for a remote (e.g. NFS or SNMP) drive enter:
14# DRIVE=<server>:<path>,<description>
15# DRIVE=SNMP:<host>:<community>:<device>,<description>
16#
17# Note: Be sure you have no '_' in host or community
18# when using SNMP.
19#
20EOF
21 
22if [ "$OUTFILE" = "settings.new" ]; then
23 cat settings | grep "^DRIVE=" >> $OUTFILE
24 echo >> $OUTFILE
25else
26 df|grep "^/"|grep -v proc|grep -v kern|grep -v above|grep -v volfs|awk '{ if ($6 == "/") { print "DRIVE="$1",root-filesystem"} else { print "DRIVE="$ 1","$6} }' >> $OUTFILE
27 fi
28 
29echo
30echo "Please check the settings file and adapt it to satisfy your needs."
31if [ "$OUTFILE" = "settings.new" ]; then
32 mkdir -p backup
33 NOW=`date +%Y%m%d-%H%M%S`
34 mv -f settings backup/settings-$NOW
35 mv -f settings.new settings
36 echo "a backup of the previous settings has been saved."
37 fi
38echo
39 

Powered by WebSVN 2.2.1