# # # patch "install" # from [2ba9207f32db25878d8f7fc7dc2e1c50ccf5927e] # to [bd29592101ce4b7a0271986926af0afa80ef2baf] # ============================================================ --- install 2ba9207f32db25878d8f7fc7dc2e1c50ccf5927e +++ install bd29592101ce4b7a0271986926af0afa80ef2baf @@ -30,12 +30,19 @@ make usher.webhost cp usher.webhost $BINDIR/ cp dbrotate.sh $BINDIR/update-viewmtn-db.sh - - if ! [ -d /etc/$NAME ]; then - mkdir $CONFDIR/ - dd if=/dev/random of=$CONFDIR/secfile bs=1 count=64 - chgrp $WEBUSER $CONFDIR/secfile - chmod 0400 $CONFDIR/secfile + if [ ! -d /etc/$NAME ] || [ "$1" == "--force-conffiles" ]; then + if [ -d /etc/$NAME ]; then + echo "Replacing your configuration..." + else + mkdir $CONFDIR/ + dd if=/dev/random of=$CONFDIR/secfile bs=1 count=64 + chgrp $WEBUSER $CONFDIR/secfile + chmod 0400 $CONFDIR/secfile + fi + if [ -f $CONFDIR/hostconfig ]; then + mv -v $CONFDIR/hostconfig $CONFDIR/hostconfig.old + echo "Your previous hostconfig file has been moved to hostconfig.old" + fi cp hostconfig.dist $CONFDIR/hostconfig cp skel/monotonerc $CONFDIR/ sed -i "s!DBROTATE!$BINDIR/update-viewmtn-db.sh!" $CONFDIR/monotonerc @@ -48,7 +55,7 @@ cp webhost.initscript /etc/init.d/$NAME sed -i "s!BINDIR!$BINDIR!" /etc/init.d/$NAME - sed -i "s!CONFDIR!$CONFDIR'!" /etc/init.d/$NAME + sed -i "s!CONFDIR!$CONFDIR!" /etc/init.d/$NAME sed -i "s!USHERUSER!$USHERUSER!" /etc/init.d/$NAME cp webhost.cronjob /etc/cron.daily/$NAME @@ -63,5 +70,5 @@ sed -i "s!'CONFDIR'!'$CONFDIR'!" $WWWDIR/viewmtn/config.py } -do_install +do_install "$1"