mirror of https://git.envs.net/envs/burrow.git
added a config option for gophernicus setting, defaulted to true
This commit is contained in:
parent
84cc1efcd5
commit
e71e2ae579
15
burrow
15
burrow
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
version="v1.7.6"
|
version="v1.7.7"
|
||||||
|
|
||||||
configfiles="/etc/burrow/config $HOME/.config/burrow/config $HOME/.config/burrow $HOME/.burrow"
|
configfiles="/etc/burrow/config $HOME/.config/burrow/config $HOME/.config/burrow $HOME/.burrow"
|
||||||
|
|
||||||
|
@ -21,6 +21,7 @@ config_gopher_desc="Description"
|
||||||
config_rss_num_entries="10"
|
config_rss_num_entries="10"
|
||||||
config_phlog_autorss=false
|
config_phlog_autorss=false
|
||||||
config_gophermap_omitserver=false
|
config_gophermap_omitserver=false
|
||||||
|
config_gophernicus=true
|
||||||
|
|
||||||
# coreutils function wrappers
|
# coreutils function wrappers
|
||||||
stat_func () {
|
stat_func () {
|
||||||
|
@ -247,7 +248,11 @@ make_post_process_formatting () {
|
||||||
if [ $config_autoindent ]; then
|
if [ $config_autoindent ]; then
|
||||||
temp_post=$(mktemp -t "$(basename "$0").post.XXXXXXX") || \
|
temp_post=$(mktemp -t "$(basename "$0").post.XXXXXXX") || \
|
||||||
die "Failed to create temporary file" 1
|
die "Failed to create temporary file" 1
|
||||||
awk -v server="${config_gopher_server}" -v port="${config_gopher_port}" '/(^[0-9cdghisGIT;\+].*\t|^[=\*\%\#\!\:\~\.].*)/ {print $0; next} {print "i" $0 "\t\t" server "\t" port}' "$post_file" > "${temp_post}"
|
if [ $config_gophernicus ]; then
|
||||||
|
awk -v server="${config_gopher_server}" -v port="${config_gopher_port}" '/(^[0-9cdghisGIT;\+].*\t|^[=\*\%\#\!\-\:\~\.].*)/ {print $0; next} {print "i" $0 "\t\t" server "\t" port}' "$post_file" > "${temp_post}"
|
||||||
|
else
|
||||||
|
awk -v server="${config_gopher_server}" -v port="${config_gopher_port}" '/^[0-9cdghisGIT;\+].*\t/ {print $0; next} {print "i" $0 "\t\t" server "\t" port}' "$post_file" > "${temp_post}"
|
||||||
|
fi
|
||||||
# create post file normally to respect umask
|
# create post file normally to respect umask
|
||||||
touch "${post_file}"
|
touch "${post_file}"
|
||||||
cat "${temp_post}" > "${post_file}"
|
cat "${temp_post}" > "${post_file}"
|
||||||
|
@ -584,6 +589,11 @@ quickstart () {
|
||||||
read -r config_gopher_port
|
read -r config_gopher_port
|
||||||
printf "Root directory of your gopher site? "
|
printf "Root directory of your gopher site? "
|
||||||
read -r config_gopher_root
|
read -r config_gopher_root
|
||||||
|
if yesno "Is your gopher server 'gophernicus'? "; then
|
||||||
|
config_gophernicus=true
|
||||||
|
else
|
||||||
|
config_gophernicus=false
|
||||||
|
fi
|
||||||
# add trailing slash if missing
|
# add trailing slash if missing
|
||||||
config_gopher_root="${config_gopher_root%/}/"
|
config_gopher_root="${config_gopher_root%/}/"
|
||||||
if yesno "Create a phlog? "; then
|
if yesno "Create a phlog? "; then
|
||||||
|
@ -654,6 +664,7 @@ create_config () {
|
||||||
printf "config_git_push=%s\\n" "$config_git_push"
|
printf "config_git_push=%s\\n" "$config_git_push"
|
||||||
printf "\\n"
|
printf "\\n"
|
||||||
printf "config_autoindent=%s\\n" "$config_autoindent"
|
printf "config_autoindent=%s\\n" "$config_autoindent"
|
||||||
|
printf "config_gophernicus=%s\\n" "$config_gophernicus"
|
||||||
printf "\\n"
|
printf "\\n"
|
||||||
printf "config_file_rss=\"%s\"\\n" "$config_file_rss"
|
printf "config_file_rss=\"%s\"\\n" "$config_file_rss"
|
||||||
printf "config_gopher_name=\"%s\"\\n" "$config_gopher_name"
|
printf "config_gopher_name=\"%s\"\\n" "$config_gopher_name"
|
||||||
|
|
Loading…
Reference in New Issue