Dateien hochladen nach „“
This commit is contained in:
14
DockerHub_Pull_Count
Normal file
14
DockerHub_Pull_Count
Normal file
@@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
USERNAME="ich777"
|
||||
SUM=0
|
||||
|
||||
REPOS="$(curl -s https://hub.docker.com/v2/repositories/${USERNAME}/?page_size=9999 | jq -r '.results|.[]|.name')"
|
||||
|
||||
while read -r line
|
||||
do
|
||||
PULLS="$(curl -s https://hub.docker.com/v2/repositories/${USERNAME}/$line/ | jq -r '.pull_count')"
|
||||
echo ""$(echo ${PULLS} | xargs printf "%'d\n")" pulls from repository ${line}"
|
||||
SUM=$(expr $SUM + $PULLS)
|
||||
done <<< "${REPOS}"
|
||||
|
||||
echo "Total pulls from repository ${USERNAME}: "$(echo ${SUM} | xargs printf "%'d\n")""
|
21
InspIRCd_SSL_check
Normal file
21
InspIRCd_SSL_check
Normal file
@@ -0,0 +1,21 @@
|
||||
HOST=10.0.0.1
|
||||
SSH_KEY_FILE_PATH=""
|
||||
LOGIN_USER="root"
|
||||
PATH_TO_SSLCERT="/mnt/user/appdata/swag/etc/letsencrypt/live/YOURDOMAIN.EXPL"
|
||||
PATH_TO_INSPIRCD="/mnt/user/appdata/inspircd/conf"
|
||||
GOTIFY_URL=""
|
||||
GOTIFY_TOKEN=""
|
||||
|
||||
FOREIGN_DATE="$(ssh -i ${SSH_KEY_FILE_PATH} ${LOGIN_USER}@${HOST} "date -r ${PATH_TO_SSLCERT}/fullchain.pem "+%Y-%m-%d_%H.%M.%S"")"
|
||||
CURRENT_DATE="$(date -r ${PATH_TO_INSPIRCD}/cert.pem "+%Y-%m-%d_%H.%M.%S")"
|
||||
|
||||
if [ "${FOREIGN_DATE}" != "${CURRENT_DATE}" ]; then
|
||||
scp -p -i ${SSH_KEY_FILE_PATH} ${LOGIN_USER}@${HOST}:${PATH_TO_SSLCERT}/fullchain.pem ${PATH_TO_INSPIRCD}/cert.pem
|
||||
scp -p -i ${SSH_KEY_FILE_PATH} ${LOGIN_USER}@${HOST}:${PATH_TO_SSLCERT}/privkey.pem ${PATH_TO_INSPIRCD}/key.pem
|
||||
chown 99:100 ${PATH_TO_INSPIRCD}/cert.pem ${PATH_TO_INSPIRCD}/key.pem
|
||||
chmod 770 ${PATH_TO_INSPIRCD}/cert.pem ${PATH_TO_INSPIRCD}/key.pem
|
||||
GOTIFY_TITLE="InspIRCd"
|
||||
GOTIFY_MESSAGE="New SSL Certificat available please issue '/REHASH' and '/REHASH ssl' as OPER on your InspIRCd server!"
|
||||
GOTIFY_PRIORITY=4
|
||||
wget -qO- "${GOTIFY_URL}/message?token=${GOTIFY_TOKEN}" --post-data "title=${GOTIFY_TITLE}&message=${GOTIFY_MESSAGE}&priority=${GOTIFY_PRIORITY}" &>/dev/null
|
||||
fi
|
23
Jenkins Delete Build histroy
Normal file
23
Jenkins Delete Build histroy
Normal file
@@ -0,0 +1,23 @@
|
||||
MAX_BUILDS = 5
|
||||
def jobName = "github-test"
|
||||
|
||||
|
||||
def job = Jenkins.instance.getItem(jobName)
|
||||
|
||||
println ""
|
||||
|
||||
println "selected Jenkins Job : "
|
||||
println job.name
|
||||
|
||||
def recent = job.builds.limit(MAX_BUILDS)
|
||||
println recent
|
||||
|
||||
for (build in job.builds) {
|
||||
if (!recent.contains(build)) {
|
||||
println ""
|
||||
println "========================================================="
|
||||
println "Preparing to delete: " + build
|
||||
build.delete()
|
||||
println ""
|
||||
}
|
||||
}
|
46
releases downloader github
Normal file
46
releases downloader github
Normal file
@@ -0,0 +1,46 @@
|
||||
GITHUB_USER=""
|
||||
GITHUB_SECRET=""
|
||||
|
||||
REPO_OWNER="ich777"
|
||||
REPO_NAME="unraid-nvidia-driver"
|
||||
|
||||
BASE_PATH=~/Repo
|
||||
|
||||
#Get all release numbers:
|
||||
RELEASES="$(curl -u $GITHUB_USER:$GITHUB_SECRET -s -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/${REPO_OWNER}/${REPO_NAME}/tags | jq -r '.[].name')"
|
||||
if [ -z "${RELEASES}" ]; then
|
||||
echo "Something went wrong, can't get Releases"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#Create folders for releases:
|
||||
if [ ! -d ${BASE_PATH} ]; then
|
||||
mkdir -p ${BASE_PATH}
|
||||
fi
|
||||
while read -r line
|
||||
do
|
||||
mkdir -p ${BASE_PATH}/$line
|
||||
done <<< "${RELEASES}"
|
||||
|
||||
#Download releases:
|
||||
while read -r line
|
||||
do
|
||||
cd ${BASE_PATH}/$line
|
||||
DL_URLS="$(curl -u $GITHUB_USER:$GITHUB_SECRET -s -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/${REPO_OWNER}/${REPO_NAME}/releases/tags/$line | jq -r '.assets[].browser_download_url')"
|
||||
echo "Staring download(s) for Release: $line"
|
||||
if [ -z "${DL_URLS}" ]; then
|
||||
echo "Something went wrong, can't get download URLs"
|
||||
exit 1
|
||||
fi
|
||||
while read -r line
|
||||
do
|
||||
wget -q -nc --show-progress $line
|
||||
done <<< "${DL_URLS}"
|
||||
done <<< "${RELEASES}"
|
||||
cd ${BASE_PATH}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
51
releases upload
Normal file
51
releases upload
Normal file
@@ -0,0 +1,51 @@
|
||||
GITHUB_USER=""
|
||||
GITHUB_SECRET=""
|
||||
export GITHUB_TOKEN=$GITHUB_SECRET
|
||||
BASE_PATH="~/repo"
|
||||
|
||||
|
||||
FILENAME="sound"
|
||||
export GITHUB_RELEASE_APP_NAME="Nvidia Driver"
|
||||
export GITHUB_USERNAME="ich777"
|
||||
export GITHUB_REPO_NAME="unraid-nvidia-driver"
|
||||
|
||||
|
||||
#Get directories
|
||||
DIRECTORIES="$(find ${BASE_PATH} -maxdepth 1 -type d | tail -n +2 | sort -V)"
|
||||
CUT=$(($(grep -o '/' <<< "$BASE_PATH" | wc -l) + 2))
|
||||
DIRECTORIES="$(echo "${DIRECTORIES}" | cut -d '/' -f ${CUT})"
|
||||
|
||||
#Download Github Release
|
||||
cd /tmp
|
||||
if [ ! -d /tmp/GitHubRelease ]; then
|
||||
mkdir -p /tmp/GitHubRelease
|
||||
fi
|
||||
if [ ! -f /tmp/GitHubRelease/github-release ]; then
|
||||
wget -O /tmp/GitHubRelease/github-release "https://fastdl.minenet.at/GithubRelease/github-release"
|
||||
fi
|
||||
chmod +x /tmp/GitHubRelease/github-release
|
||||
|
||||
|
||||
while read -r line
|
||||
do
|
||||
cd ${BASE_PATH}/$line
|
||||
if [ ! -z "$(ls -1 | grep "${FILENAME}")" ]; then
|
||||
/tmp/GitHubRelease/github-release release \
|
||||
--user $GITHUB_USERNAME \
|
||||
--repo $GITHUB_REPO_NAME \
|
||||
--tag $line \
|
||||
--name "$line" \
|
||||
--description "$GITHUB_RELEASE_APP_NAME plugin package(s) for Unraid Kernel v${line%%-*} by ich777"
|
||||
|
||||
ls -1 | grep "${FILENAME}" | xargs -n1 -P0 -I{} -- \
|
||||
/tmp/GitHubRelease/github-release upload \
|
||||
--user $GITHUB_USERNAME \
|
||||
--repo $GITHUB_REPO_NAME \
|
||||
--tag $line \
|
||||
--name {} \
|
||||
--file {}
|
||||
sleep 15m
|
||||
fi
|
||||
done <<< "${DIRECTORIES}"
|
||||
|
||||
|
19
rename packages
Normal file
19
rename packages
Normal file
@@ -0,0 +1,19 @@
|
||||
BASE_PATH="~/Repo"
|
||||
PACKAGE_NAME="nvidia"
|
||||
|
||||
|
||||
#Get directories
|
||||
DIRECTORIES="$(find ${BASE_PATH} -maxdepth 1 -type d | tail -n +2 | sort -V)"
|
||||
CUT=$(($(grep -o '/' <<< "$BASE_PATH" | wc -l) + 2))
|
||||
DIRECTORIES="$(echo "${DIRECTORIES}" | cut -d '/' -f ${CUT})"
|
||||
|
||||
while read -r line
|
||||
do
|
||||
cd ${BASE_PATH}/$line
|
||||
if [ ! -z "$(ls | grep "${PACKAGE_NAME}")" ]; then
|
||||
PKG_NAME="$(ls | grep "${PACKAGE_NAME}" | grep -v ".md5" | cut -d '-' -f 1)"
|
||||
PKG="$(ls | grep "${PKG_NAME}" | grep -v ".md5")"
|
||||
mv $PKG ${PKG_NAME}-plugin-${line}-1.${PKG##*.}
|
||||
mv ${PKG}.md5 ${PKG_NAME}-plugin-${line}-1.${PKG##*.}.md5
|
||||
fi
|
||||
done <<< "${DIRECTORIES}"
|
Reference in New Issue
Block a user