mirror of
https://github.com/DictXiong/dxsync.git
synced 2026-10-16 01:38:17 +08:00
Compare commits
3 Commits
71cfa14596
...
dev
| Author | SHA1 | Date | |
|---|---|---|---|
| 4ece102919 | |||
| 631da6652a | |||
| 718274af9d |
@@ -42,14 +42,14 @@
|
|||||||
<script src="https://tools.beardic.cn/js/pagemap.min.js"></script>
|
<script src="https://tools.beardic.cn/js/pagemap.min.js"></script>
|
||||||
<script src="https://tools.beardic.cn/js/page.js"></script>
|
<script src="https://tools.beardic.cn/js/page.js"></script>
|
||||||
|
|
||||||
<title>ibd.ink / mirrors</title>
|
<title>Status of Mirrors</title>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<section class="container md-shadow">
|
<section class="container md-shadow">
|
||||||
<article>
|
<article>
|
||||||
<header>
|
<header>
|
||||||
<h1>ibd.ink / mirrors: Status</h1>
|
<h1><span id="hostname"></span>/mirrors: status</h1>
|
||||||
</header>
|
</header>
|
||||||
<table align="center">
|
<table align="center">
|
||||||
<thead>
|
<thead>
|
||||||
@@ -70,6 +70,7 @@
|
|||||||
</section>
|
</section>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
$("#hostname").text(window.location.hostname);
|
||||||
$.get("index", function(data){
|
$.get("index", function(data){
|
||||||
const list = data.split('\n')
|
const list = data.split('\n')
|
||||||
for (i in list) {
|
for (i in list) {
|
||||||
|
|||||||
9
sync.sh
9
sync.sh
@@ -30,6 +30,9 @@ locked() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
do_sync() {
|
do_sync() {
|
||||||
|
if [[ -z "$1" ]]; then
|
||||||
|
return
|
||||||
|
fi
|
||||||
local name="$1"
|
local name="$1"
|
||||||
local safe_name="${name//\//_}"
|
local safe_name="${name//\//_}"
|
||||||
local src="$2"
|
local src="$2"
|
||||||
@@ -50,10 +53,14 @@ do_sync() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
append_index() {
|
append_index() {
|
||||||
|
if [[ -z "$1" ]]; then
|
||||||
|
return
|
||||||
|
fi
|
||||||
echo "$1" >> "$STATUS_INDEX"
|
echo "$1" >> "$STATUS_INDEX"
|
||||||
}
|
}
|
||||||
|
|
||||||
echo > "$STATUS_INDEX"
|
rm "$STATUS_INDEX"
|
||||||
|
touch "$STATUS_INDEX"
|
||||||
while read p || [[ -n $p ]]; do
|
while read p || [[ -n $p ]]; do
|
||||||
append_index $p
|
append_index $p
|
||||||
done < "$THIS_DIR"/config
|
done < "$THIS_DIR"/config
|
||||||
|
|||||||
Reference in New Issue
Block a user