From 301390f9c4b6f0e1574e4bf21d42693a18e7e561 Mon Sep 17 00:00:00 2001 From: malc Date: Fri, 31 Aug 2007 00:17:15 +0400 Subject: [PATCH] Initial stab at "user-friendly" APC loader --- apc-linux.run | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100755 apc-linux.run diff --git a/apc-linux.run b/apc-linux.run new file mode 100755 index 0000000..494dbc1 --- /dev/null +++ b/apc-linux.run @@ -0,0 +1,36 @@ +set -e + +dev="/dev/itc" + +! test `uname -s` = "Linux" && { + echo `uname -s` is not Linux + exit 1 +} + +case `uname -r | cut -d. -f1,2` in + 2.6) kms=ko;; + 2.4) kms=o;; + *) echo "unknown kernel version"; exit 1;; +esac + + +test -e "build/itc.$kms" && kmod=build/itc.$kms +test -z "$kmod" && test -e "mod/itc.$kms" && kmod=mod/itc.$kms + +test -z "$kmod" && { + echo "Kernel module does not exist" + exit 1 +} + +if ! test -c $dev; then + echo "ITC kernel module is not running. Will try to load $kmod." + su -c "insmod $kmod" +fi + +if ! test -r $dev; then + echo "ITC is not readable. Will try to change mode." + su -c "chmod +r $dev" +fi + +./apc -d $dev & disown +echo "apc should be running now" -- 2.11.4.GIT