![]() ![]() |
hotsanic |
Subversion Repositories: |
Compare with Previous - Blame - Download
#!/usr/bin/env shif ! [ -e settings ]; then OUTFILE="settings"; else OUTFILE="settings.new"; ficat > $OUTFILE << EOF# You may configure partitions you would like to monitor.# multiple lines are of course allowed.## for a local drive enter:# DRIVE=<device>,<description>## for a remote (e.g. NFS or SNMP) drive enter:# DRIVE=<server>:<path>,<description># DRIVE=SNMP:<host>:<community>:<device>,<description>## Note: Be sure you have no '_' in host or community# when using SNMP.#EOFif [ "$OUTFILE" = "settings.new" ]; thencat settings | grep "^DRIVE=" >> $OUTFILEecho >> $OUTFILEelsedf|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} }' >> $OUTFILEfiechoecho "Please check the settings file and adapt it to satisfy your needs."if [ "$OUTFILE" = "settings.new" ]; thenmkdir -p backupNOW=`date +%Y%m%d-%H%M%S`mv -f settings backup/settings-$NOWmv -f settings.new settingsecho "a backup of the previous settings has been saved."fiecho