1 uci_remove_list_element() {
4 local list="$(uci get $option)"
9 if [ "$elem" != "$value" ]; then
10 uci add_list $option=$elem
16 # $1 = text to be displayed in the output for this section
17 # $2 = section (optional)
20 uci changes $2 | while read line; do
27 for def in $(env |grep "^$1"); do
33 # 1 argument: section to remove
35 uci -q delete $1 && msg_cleanup $1 || msg_cleanup_error $1
38 # 3 arguements: 1=config name 2=oldname 3=newname
40 uci -q rename $1.$2=$3 && msg_rename $1.$2 $1.$3 || msg_rename_error $1.2 $1.$3
44 echo " Cleanup: Removed section $1."
48 echo -e " \033[1mWarning:\033[0m Cleanup of $1 failed."
52 echo -e " \033[1mWarning:\033[0m Configuration option for $2 is missing in $1."
60 echo " \033[1mError: \033[0mThere was a problem."
64 echo " Renamed unnamed section $1 to $2."
68 echo " \033[1mWarning:\033[0m Could not rename $1 to $2."