mirror of https://git.envs.net/envs/ops.git
execute envs_gemini_genpage.sh in envs_user_updated.sh and not in a extra cronjob
This commit is contained in:
parent
7643802f71
commit
f2f71893ef
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env bash
|
||||
#
|
||||
# envs.net - generate index.gmi
|
||||
# - this script is called by /etc/cron.d/envs_gemini
|
||||
# - this script is called by /usr/local/bin/envs.net/envs_user_updated.sh
|
||||
#
|
||||
|
||||
[ "$(id -u)" -ne 0 ] && printf 'Please run as root!\n' && exit 1
|
||||
|
|
|
@ -1,7 +1,11 @@
|
|||
#!/usr/bin/env bash
|
||||
#
|
||||
# envs.net - generate user_updates.php and users_info.json
|
||||
# - this script is called by /etc/cron.d/envs_sysinfo
|
||||
# envs.net - generate the following static sites
|
||||
# - users_info.json
|
||||
# - user_updates.php
|
||||
# - gemini index.gmi
|
||||
#
|
||||
# this script is called by /etc/cron.d/envs_sysinfo
|
||||
#
|
||||
WWW_PATH='/var/www/envs.net'
|
||||
DOMAIN="envs.net"
|
||||
|
@ -9,17 +13,6 @@ DOMAIN="envs.net"
|
|||
|
||||
[ "$(id -u)" -ne 0 ] && printf 'Please run as root!\n' && exit 1
|
||||
|
||||
#
|
||||
# user_updates.php
|
||||
#
|
||||
|
||||
LIST="$(stat --format=%Z\ %n /home/*/public_html/* | grep -v updated | grep -v your_index_template.php | grep -v cgi-bin | sort -r)"
|
||||
echo "$LIST" | perl /usr/local/bin/envs.net/envs_user_updated_genpage.pl > /tmp/user_updates.php_tmp
|
||||
|
||||
mv /tmp/user_updates.php_tmp "$WWW_PATH"/user_updates.php
|
||||
chown root:www-data "$WWW_PATH"/user_updates.php
|
||||
|
||||
|
||||
#
|
||||
# users_info.json
|
||||
#
|
||||
|
@ -228,5 +221,24 @@ EOM
|
|||
mv "$TMP_JSON" "$WWW_PATH"/users_info.json
|
||||
chown root:www-data "$WWW_PATH"/users_info.json
|
||||
|
||||
|
||||
#
|
||||
# user_updates.php
|
||||
#
|
||||
|
||||
LIST="$(stat --format=%Z\ %n /home/*/public_html/* | grep -v updated | grep -v your_index_template.php | grep -v cgi-bin | sort -r)"
|
||||
echo "$LIST" | perl /usr/local/bin/envs.net/envs_user_updated_genpage.pl > /tmp/user_updates.php_tmp
|
||||
|
||||
mv /tmp/user_updates.php_tmp "$WWW_PATH"/user_updates.php
|
||||
chown root:www-data "$WWW_PATH"/user_updates.php
|
||||
|
||||
|
||||
#
|
||||
# gemini index.gmi
|
||||
#
|
||||
|
||||
/usr/local/bin/envs.net/envs_gemini_genpage.sh
|
||||
|
||||
|
||||
#
|
||||
exit 0
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
#
|
||||
# generate envs gemini - index.gem (once per hour)
|
||||
#
|
||||
SHELL=/bin/sh
|
||||
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
|
||||
|
||||
0 * * * * root /usr/local/bin/envs.net/envs_gemini_genpage.sh >/dev/null 2>&1
|
Loading…
Reference in New Issue