#!/bin/sh
# install symlinks, preserver original if exist

# init
[ -e ./sbin/init ] && mv ./sbin/init  ./sbin/init-FULL
ln -s ../bin/busybox-init ./sbin/init

# klogd and syslogd
[ -e ./sbin/klogd ]   && mv ./sbin/klogd   ./sbin/klogd-FULL
[ -e ./sbin/syslogd ] && mv ./sbin/syslogd ./sbin/syslogd-FULL
ln -s ../bin/busybox-logger ./sbin/klogd
ln -s ../bin/busybox-logger ./sbin/syslogd

# login passwd su getty
[ -e ./bin/login ]   && mv ./bin/login   ./bin/login-FULL
[ -e ./bin/passwd ]  && mv ./bin/passwd  ./bin/passwd-FULL
[ -e ./bin/su ]      && mv ./bin/su      ./bin/su-FULL
[ -e ./sbin/getty ]  && mv ./sbin/gettty ./sbin/getty-FULL
ln -s busybox-login ./bin/login
ln -s busybox-login ./bin/passwd
ln -s busybox-login ./bin/su
ln -s ../bin/busybox-login ./sbin/getty

# crond crontab
[ -e ./bin/crontab ] && mv ./bin/crontab  ./bin/crontab-FULL
[ -e ./sbin/crond ]  && mv ./sbin/crond   ./sbin/crond-FULL
ln -s busybox-cron        ./bin/crontab
ln -s ../bin/busybox-cron ./sbin/crond
