Initial stab at "user-friendly" APC loader
[apc.git] / apc-linux.run
blob494dbc174ca53f7f1e7a20b652b49bdce6a9f2e1
1 set -e
3 dev="/dev/itc"
5 ! test `uname -s` = "Linux" && {
6 echo `uname -s` is not Linux
7 exit 1
10 case `uname -r | cut -d. -f1,2` in
11 2.6) kms=ko;;
12 2.4) kms=o;;
13 *) echo "unknown kernel version"; exit 1;;
14 esac
17 test -e "build/itc.$kms" && kmod=build/itc.$kms
18 test -z "$kmod" && test -e "mod/itc.$kms" && kmod=mod/itc.$kms
20 test -z "$kmod" && {
21 echo "Kernel module does not exist"
22 exit 1
25 if ! test -c $dev; then
26 echo "ITC kernel module is not running. Will try to load $kmod."
27 su -c "insmod $kmod"
30 if ! test -r $dev; then
31 echo "ITC is not readable. Will try to change mode."
32 su -c "chmod +r $dev"
35 ./apc -d $dev & disown
36 echo "apc should be running now"