19 lines
573 B
Bash
Executable File
19 lines
573 B
Bash
Executable File
#!/bin/bash
|
|
CONFIG_FILE="${2}"
|
|
#arr+=( ["blend_name"]="devuan-live" \
|
|
# ["blend_vers"]="2.0" \
|
|
# ["mirror"]="http://192.168.44.47:3142/pkgmaster.devuan.org/merged" \
|
|
# ["release"]="ascii" )
|
|
|
|
declare -A arr
|
|
arr+=( "${1}" )
|
|
|
|
for TARGET_KEY in "${!arr[@]}"; do
|
|
echo ${TARGET_KEY} ${arr[${TARGET_KEY}]} ${CONFIG_FILE}
|
|
if grep -q "^${TARGET_KEY}=" ${CONFIG_FILE}; then
|
|
sed -i "s|^${TARGET_KEY}.*|${TARGET_KEY}=\"${arr[${TARGET_KEY}]}\"|" ${CONFIG_FILE}
|
|
else
|
|
sed -i "/^blend_name=.*/ s|.*|&\n${TARGET_KEY}=\"${arr[${TARGET_KEY}]}\"|" ${CONFIG_FILE}
|
|
fi
|
|
done
|