move old files to old directory
Signed-off-by: Václav Valíček <valicek1994@gmail.com>
This commit is contained in:
35
old/dockerbin/run-mirror-update
Executable file
35
old/dockerbin/run-mirror-update
Executable file
@@ -0,0 +1,35 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
IFS=$'\n\t'
|
||||
|
||||
function log(){
|
||||
local title=${raw:-$name}
|
||||
[ -z "$title" ] || title=" [$title]"
|
||||
echo "[$(date +"%X")]$title $@"
|
||||
}
|
||||
|
||||
function die(){
|
||||
log "$@" 1>&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
||||
scratch=$(mktemp -d -t tmp.XXXXXXXXXX)
|
||||
function finish {
|
||||
rm -rf "$scratch"
|
||||
}
|
||||
trap finish EXIT
|
||||
|
||||
|
||||
# necessary checks
|
||||
pathto=${1:-}
|
||||
[ -n "$pathto" ] || die "No project specified"
|
||||
|
||||
raw=$(basename $pathto | sed 's/^cloner-//g')
|
||||
|
||||
# is it enabled?
|
||||
[ -f "$pathto/.enabled" ] || die "$raw not enabled!"
|
||||
|
||||
|
||||
env BASE=$pathto run-checker | while read line; do log "$line"; done
|
||||
|
||||
Reference in New Issue
Block a user