tükörképe a:
https://git.openwrt.org/project/luci.git
synced 2025-01-18 15:43:42 +00:00
5c6b08cf89
The conversion adds the missing parameters in the UI which is configurable in the principal package. Assumption has been made that the config file is stored in /etc/squid since the principal package limits the sysconfdir to this directory. If that assumption is changed in the future we need to adjust the ACL. Signed-off-by: Daniel Nilsson <dannil+github@protonmail.com>
39 sor
699 B
Bash
39 sor
699 B
Bash
#!/bin/sh
|
|
|
|
# Reference: https://openwrt.org/docs/techref/rpcd
|
|
|
|
. /usr/share/libubox/jshn.sh
|
|
|
|
get_compile_time_options() {
|
|
# Extract all options that begins with '--' as a comma-separated string
|
|
source="$(squid -v)"
|
|
options="$(echo $source | grep -o "'--[^']*'" | sed "s/'//g")"
|
|
|
|
json_init
|
|
json_add_array 'options'
|
|
# For each option, add it to the array
|
|
set -- $options
|
|
for option; do
|
|
json_add_string '' "$option"
|
|
done
|
|
json_close_array
|
|
json_dump
|
|
json_cleanup
|
|
}
|
|
|
|
case "$1" in
|
|
list)
|
|
json_init
|
|
json_add_object 'getCompileTimeOptions'
|
|
json_close_object
|
|
json_dump
|
|
json_cleanup
|
|
;;
|
|
call)
|
|
case "$2" in
|
|
getCompileTimeOptions)
|
|
get_compile_time_options
|
|
;;
|
|
esac
|
|
;;
|
|
esac
|