summaryrefslogtreecommitdiffstats
path: root/source/script/installmodules.sh
diff options
context:
space:
mode:
Diffstat (limited to 'source/script/installmodules.sh')
-rwxr-xr-xsource/script/installmodules.sh27
1 files changed, 27 insertions, 0 deletions
diff --git a/source/script/installmodules.sh b/source/script/installmodules.sh
new file mode 100755
index 00000000000..f7c74733381
--- /dev/null
+++ b/source/script/installmodules.sh
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+INSTALLPERMS=$1
+BASEDIR=`echo $2 | sed 's/\/\//\//g'`
+LIBDIR=`echo $3 | sed 's/\/\//\//g'`
+shift
+shift
+shift
+
+for d in $BASEDIR $LIBDIR; do
+if [ ! -d $d ]; then
+mkdir $d
+if [ ! -d $d ]; then
+ echo Failed to make directory $d
+ exit 1
+fi
+fi
+done
+
+for p in $*; do
+ p2=`basename $p`
+ echo Installing $p as $LIBDIR/$p2
+ cp -f $p $LIBDIR/
+ chmod $INSTALLPERMS $LIBDIR/$p2
+done
+
+exit 0