local value="$3"
if [ -n "$value" ]; then
- echo "$option = $value" >> "$cfgfile"
+ echo "$option = $value" >>"$cfgfile"
fi
}
local hostlist=""
local value
- echo "[$cfg]" >> "$cfgfile"
+ echo "[$cfg]" >>"$cfgfile"
case $cfg in
server)
headers)
config_get cors "$cfg" cors
if [ -n "$cors" ]; then
- echo "Access-Control-Allow-Origin = $cors" >> "$cfgfile"
+ echo "Access-Control-Allow-Origin = $cors" >>"$cfgfile"
fi
;;
- # TODO: Add sharing configuration
+ # TODO: Add sharing configuration
esac
- echo "" >> "$cfgfile"
+ echo "" >>"$cfgfile"
}
add_missing_sections() {
for section in server encoding auth rights storage web logging headers sharing; do
if ! grep -q "\[$section\]" "$cfgfile"; then
- echo "[$section]" >> "$cfgfile"
+ echo "[$section]" >>"$cfgfile"
case $section in
server)
- echo "hosts = 127.0.0.1:5232, [::1]:5232" >> "$cfgfile"
+ echo "hosts = 127.0.0.1:5232, [::1]:5232" >>"$cfgfile"
;;
auth)
- echo "type = htpasswd" >> "$cfgfile"
- echo "htpasswd_filename = $USRCFG" >> "$cfgfile"
- echo "htpasswd_encryption = plain" >> "$cfgfile"
+ echo "type = htpasswd" >>"$cfgfile"
+ echo "htpasswd_filename = $USRCFG" >>"$cfgfile"
+ echo "htpasswd_encryption = plain" >>"$cfgfile"
;;
storage)
- echo "filesystem_folder = $DATADIR" >> "$cfgfile"
+ echo "filesystem_folder = $DATADIR" >>"$cfgfile"
;;
esac
- echo "" >> "$cfgfile"
+ echo "" >>"$cfgfile"
fi
done
}
config_get name "$cfg" name
config_get password "$cfg" password
- [ -n "$name" ] && echo "$name:$password" >> "$tmpfile"
+ [ -n "$name" ] && echo "$name:$password" >>"$tmpfile"
}
build_users() {
chmod 0750 "$CFGDIR"
chgrp radicale3 "$CFGDIR"
- cat "$tmpconf" > "$SYSCFG"
- cat "$tmpusers" > "$USRCFG"
+ cat "$tmpconf" >"$SYSCFG"
+ cat "$tmpusers" >"$USRCFG"
chmod 0640 "$SYSCFG" "$USRCFG"
chgrp radicale3 "$SYSCFG" "$USRCFG"