#!/bin/bash

UNAME=`uname -r`
MOUNT_PATH=/opt/data
LOG_PATH=/usr/local/ucloud/binlog/
RC=/etc/init.d/wiwo

cp -f etc/init.d/binlogdev /etc/init.d/
chmod +x /etc/init.d/binlogdev

[[ -d $MOUNT_PATH ]] || mkdir -p $MOUNT_PATH
[[ -d $LOG_PATH ]] || mkdir -p $LOG_PATH

sed -i "/binlogdev/d" $RC 
sed -i "/\/root\/wiwo\/bin\/wiwo_watchdog/i\/etc\/init.d\/binlogdev start\n" $RC
/etc/init.d/binlogdev force-format
