mirror of
https://github.com/edu4rdshl/nspawn-utils.git
synced 2026-07-17 23:24:53 +00:00
Update all
This commit is contained in:
parent
b2115580a5
commit
bea1a27e1f
3 changed files with 8 additions and 5 deletions
|
|
@ -7,7 +7,7 @@ Type=simple
|
|||
WorkingDirectory=/var/www/html/storage
|
||||
Restart=always
|
||||
RestartSec=10
|
||||
ExecStart=/usr/bin/nspawn-list-generator
|
||||
ExecStart=/usr/bin/bash -c "nspawn-list-generator static && nspawn-list-generator website"
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
||||
|
|
|
|||
|
|
@ -3,8 +3,7 @@
|
|||
Description=Generate list of available images for hub.nspawn.org
|
||||
|
||||
[Timer]
|
||||
OnUnitActiveSec=5m
|
||||
OnUnitActiveSec=1m
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,11 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
if [ "$1" == "static" ]; then
|
||||
find -maxdepth 3 -not -path '*/\.*' -not -empty -print |cut -c 3- |tr '/' ' ' |sort |awk 'NF == 3' |tr ' ' '/' | awk -F/ 'BEGIN {printf("%13s | %10s | %33s \n" ,"DISTRO", "VERSION", "INIT COMMAND")} {printf "%13s | %10s | nspawn -i %s/%s/%s\n", $1, $2, $1, $2, $3}' > list.txt
|
||||
find -maxdepth 3 -not -path '*/\.*' -not -empty -print |cut -c 3- |tr '/' ' ' |sort |awk 'NF == 3' |tr ' ' '/' | awk -F/ 'BEGIN {printf("%13s | %10s | %33s \n" ,"DISTRO", "VERSION", "INIT COMMAND")} {printf "%13s | %10s | nspawn -i %s/%s/%s\n", $1, $2, $1, $2, $3}' > /var/www/html/storage/list.txt
|
||||
elif [ "$1" == "website" ]; then
|
||||
find -maxdepth 3 -not -path '*/\.*' -not -empty -print |sort|cut -c 3- |tr '/' ' ' |awk 'NF == 3' |tr ' ' '/' | awk -F/ 'BEGIN {printf("| %13s | %10s | %25s | %20s |\n%13s | %10s | %25s | %20s |\n" ,"**Linux Distribution**", "**Version**", "**Init Command**", "**Download Link**", "--------------", "------------", "---------------------------", "--------------------")} {printf "| %13s | %10s | nspawn -i %s/%s/%s | [%s-%s](/storage/%s/%s/%s/image.%s.xz)|\n", toupper(substr($1,1,1))substr($1,2), $2, $1, $2, $3, $1, $3, $1, $2, $3, $3}'
|
||||
sed -i -e '/Linux Distribution/,$d' /var/www/html/nspawn.org/content/images.md
|
||||
cd /var/www/html/storage/
|
||||
find -maxdepth 3 -not -path '*/\.*' -not -empty -print |sort|cut -c 3- |tr '/' ' ' |awk 'NF == 3' |tr ' ' '/' | awk -F/ 'BEGIN {printf("| %13s | %10s | %25s | %20s |\n%13s | %10s | %25s | %20s |\n" ,"**Linux Distribution**", "**Version**", "**Init Command**", "**Download Link**", "--------------", "------------", "---------------------------", "--------------------")} {printf "| %13s | %10s | nspawn -i %s/%s/%s | [%s-%s](/storage/%s/%s/%s/image.%s.xz)|\n", toupper(substr($1,1,1))substr($1,2), $2, $1, $2, $3, $1, $3, $1, $2, $3, $3}' >> /var/www/html/nspawn.org/content/images.md
|
||||
cd /var/www/html/nspawn.org/
|
||||
hugo -D
|
||||
fi
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue