mirror of
https://github.com/lesderid/image-archlinux
synced 2025-04-11 14:45:39 +02:00
30 lines
688 B
Bash
Executable File
30 lines
688 B
Bash
Executable File
#!/bin/sh
|
|
# description "synchronizes kernel module"
|
|
# author "Online Labs Cloud Team <cloud-team@labs.online.net>"
|
|
|
|
DIR=/lib/modules
|
|
mkdir -p $DIR
|
|
TMP_DIR=`mktemp -d -p $DIR`
|
|
KVERSION=`uname -r`
|
|
TIMEOUT=10
|
|
|
|
clean() {
|
|
rm -rf "$TMP_DIR" 2>/dev/null
|
|
}
|
|
trap 'clean' INT TERM EXIT
|
|
|
|
if [ ! -d $DIR/${KVERSION} ]
|
|
then
|
|
wget --timeout=${TIMEOUT} --quiet --no-check-certificate -r --no-parent \
|
|
--reject "index.html*" --reject "robots.txt" \
|
|
--no-host-directories --cut-dirs 3 --directory-prefix \
|
|
$TMP_DIR http://mirror.cloud.online.net/kernel/${KVERSION}/modules/${KVERSION}/
|
|
|
|
if [ $? -eq 0 ]
|
|
then
|
|
mkdir -p $DIR/${KVERSION}
|
|
mv $TMP_DIR/${KVERSION} $DIR
|
|
fi
|
|
fi
|
|
|