![]() ![]() |
hotsanic |
Subversion Repositories: |
Compare with Previous - Blame - Download
#!/usr/bin/env sh. ./settingsif [ "$1" = "" ]; thenecho "Usage:"echo "clearall <SINGLE OPTION>"echo ""echo "Options:"echo " CLEAR_DATABASES"echo " removes ALL .rrd database files!"echo " CAUTION! ALL SAMPLED DATA WILL BE LOST!!!"echo ""echo " CLEAR_WEBPAGE"echo " removes all webgraphs"echo ""echo " CLEAR_GRAPHS"echo " removes temporary files for webgraphs"echo ""echo " CLEAR_COUNTERS"echo " removes temporary files used to build the databases"echo ""echo " CLEAR_BINARIES"echo " removes compiled perls and re-installs the original"echo " scripts"echo ""echo " CLEAR_EVERYTHING"echo " does all of the things above"echo ""fiif [ "$1" = "CLEAR_BINARIES" ]; thenecho "This will slow down script-execution. Enter yes to continue"read nnif [ "$nn" = "yes" ]; thenfor nn in ./modules/*; dorm -f $nn/read-datadonefifiif [ "$1" = "CLEAR_DATABASES" ]; thenecho "This will destroy all sampled data. Enter yes to continue"read nnif [ "$nn" = "yes" ]; thenrm -rf modules/*/rrdfifiif [ "$1" = "CLEAR_WEBPAGE" ]; thenif [ -e $WEBDIR ]; thenecho "This will destroy everything under $WEBDIR and therefore your web-graphs. Enter yes to continue"read nnif [ "$nn" = "yes" ]; thencd $WEBDIRrm -f */*.html */*.gif */*.png *.html *.gif *.png convertrmdir *fififiif [ "$1" = "CLEAR_GRAPHS" ]; thenrm -rf modules/*/*.gif modules/*/*.png modules/*/expires modules/*/idxdata modules/*/index index.htmlfiif [ "$1" = "CLEAR_COUNTERS" ]; thenrm -f */*/*.dat */*/*.old *.logfiif [ "$1" = "CLEAR_EVERYTHING" ]; thenecho "This will destroy all sampled data and delete all pre-compiled PERL-scripts and clear the webpage output. Enter yes to continue"read nnif [ "$nn" = "yes" ]; thenrm -rf modules/*/rrdfifor nn in ./modules/*; dorm -f $nn/read-datadonerm -f nohup.outrm -rf modules/*/*.png modules/*/*.gif modules/*/expires modules/*/idxdata modules/*/index index.htmlrm -f */*/*.dat */*/*.old *.logcd $WEBDIRrm -f */*.html */*.gif */*.png *.html *.gif *.png convertrmdir *fi