#!/bin/sh
# Our bootchart assumes that /sbin/upstart exists
if [ ! -x /sbin/upstart ]; then
    echo "/sbin/upstart not found"
elif [ ! -x /sbin/bootchartd ]; then
    echo "/sbin/bootchartd not found"
else
    if [ ! -f /sbin/old_init ]; then
        mv /sbin/init /sbin/old_init || exit 1
    fi
    cp -a /sbin/bootchartd /sbin/init || exit 1
    mkdir -p /bootchart || exit 1
    sync
    echo "bootchart installed"
fi
