forked from tilde.black/ops
working gemini creation & operation
This commit is contained in:
parent
f23ebaf336
commit
128ca4b161
|
@ -0,0 +1,9 @@
|
|||
#!/bin/sh
|
||||
|
||||
all_users=$(grep /home < /etc/passwd | awk -F: '{print $1}')
|
||||
printf "%s" "$all_users" | while read -r n; do
|
||||
target="/var/gemini/users/${n}"
|
||||
mkdir -p "$target"
|
||||
chown "$n" "$target"
|
||||
ln -s "$target" "/home/${n}/public_gemini"
|
||||
done
|
|
@ -6,10 +6,10 @@ template_dir="${current_dir}/templates/gemini"
|
|||
output="${template_dir}/users.gemini"
|
||||
printf "[Users]\\n" > "$output"
|
||||
printf "%s" "$all_users" | while read -r n; do
|
||||
target="/var/gemini/users/${n}"
|
||||
if find "$target" -mindepth 1 -print -quit 2>/dev/null | grep -q .; then
|
||||
if [ -f "/var/gemini/users/${n}/.gemini" ]; then
|
||||
printf "=> /users/%s ~%s\\n" "$n" "$n" >> "$output"
|
||||
fi
|
||||
done
|
||||
|
||||
cat "${template_dir}/head.gemini" "${output}" > /var/gemini/.gemini
|
||||
cat "$output" > /var/gemini/users/.gemini
|
||||
|
|
|
@ -31,4 +31,4 @@ Tilde.Black is proud to support the emerging Gemini protocol.
|
|||
|
||||
=> gemini://zaibatsu.circumlunar.space Read more about Gemini
|
||||
|
||||
User pages will be coming soon.
|
||||
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
[Users]
|
||||
=> /users/fox ~fox
|
Loading…
Reference in New Issue