Switchtool

From Rsewiki
Revision as of 17:45, 28 January 2011 by Sh (talk | contribs) (New page: An easy way to make the smrs use the development branch of mobotware. Login as root on the smr and run: root@smr3:~# switchtool devel This changes to the development branch. This links ...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

An easy way to make the smrs use the development branch of mobotware.

Login as root on the smr and run:

root@smr3:~# switchtool devel

This changes to the development branch. This links the /opt/smr.development folder to /usr/local/smr on the robot. Remember that the original setup is restored on reboot. This means /opt/smr is linked to /usr/local/smr.

The switchtool is listed below and is residing in the /usr/sbin folder.

#!/bin/bash

if [ ! -d /usr/local/smr.net/bin ]; then
	echo "Switching impossible. Kalman /opt not found."
	exit 1
fi

/etc/rc.smr/rc.smr_shutdown
if [ "${1}" == "devel" ]; then
	echo "Switching to development mode"
	rm -f /usr/local/smr
	ln -sf /misc/opt/smr.development /usr/local/smr
else
	echo "Switching to production mode"
	rm -f /usr/local/smr
	ln -sf /usr/local/smr.net /usr/local/smr
fi

/etc/rc.smr/rc.smr

sleep 2
echo "done"

exit 0