mirror of
https://github.com/wekan/wekan.git
synced 2026-01-23 09:46:09 +01:00
rearranging helper scripts in snap-src
Signed-off-by: Ondrej Kubik <ondrej.kubik@canonical.com>
This commit is contained in:
parent
26f66f3cf0
commit
a533caa944
8 changed files with 0 additions and 8 deletions
36
snap-src/bin/wekan-read-settings
Executable file
36
snap-src/bin/wekan-read-settings
Executable file
|
|
@ -0,0 +1,36 @@
|
|||
#!/bin/sh
|
||||
|
||||
# read wekan config
|
||||
source $SNAP/bin/config
|
||||
|
||||
# TODO: uncomment following, once snapctl can be called from outside the hooks
|
||||
# for key in ${keys[@]}
|
||||
# do
|
||||
# # snappy is picky about key syntax, using mapping
|
||||
# MAP_KEY="KEY_$key"
|
||||
# SNAPPY_KEY=
|
||||
# if value=$(snapctl get ${!MAP_KEY}); then
|
||||
# echo "$key='$value'"
|
||||
# export $key=$value
|
||||
# else
|
||||
# # use default value
|
||||
# default_value="DEFAULT_$key"
|
||||
# echo "using default value: $key='${!default_value}'"
|
||||
# export $key=${!default_value}
|
||||
# fi
|
||||
# done
|
||||
|
||||
# TODO: get rid of this workaround once above can be used
|
||||
# loop through all values, and if not defined, use default value
|
||||
for key in ${keys[@]}
|
||||
do
|
||||
if [ "x" == "x${!key}" ]; then
|
||||
# use default value
|
||||
default_value="DEFAULT_$key"
|
||||
echo "using default value: $key='${!default_value}'"
|
||||
export $key=${!default_value}
|
||||
# echo "export $key='${!def_value}'" >> $SETTINGS_FILE
|
||||
else
|
||||
echo "$key='${!key}'"
|
||||
fi
|
||||
done
|
||||
Loading…
Add table
Add a link
Reference in a new issue