From c2e227e7ceef36a31c702a2e36db1287def00e5e Mon Sep 17 00:00:00 2001 From: bigeagle Date: Sun, 4 Dec 2016 19:05:53 +0800 Subject: [PATCH] linux-stable.git --- linux-stable.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 linux-stable.sh diff --git a/linux-stable.sh b/linux-stable.sh new file mode 100755 index 0000000..9ac4916 --- /dev/null +++ b/linux-stable.sh @@ -0,0 +1,21 @@ +#!/bin/bash +UPSTREAM=${TUNASYNC_UPSTREAM_URL:-"git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git"} + +function repo_init() { + git clone --mirror $UPSTREAM $TUNASYNC_WORKING_DIR +} + +function update_linux_git() { + cd $TUNASYNC_WORKING_DIR + echo "==== SYNC linux.git START ====" + /usr/bin/timeout -s INT 3600 git remote -v update + git repack -a -b -d + echo "==== SYNC linux.git DONE ====" +} + +if [[ ! -f "$TUNASYNC_WORKING_DIR/HEAD" ]]; then + echo "Initializing Linux.git mirror" + repo_init +fi + +update_linux_git