mirror of
https://github.com/aclist/dztui.git
synced 2024-12-28 05:12:36 +01:00
fix: return codes
This commit is contained in:
parent
f57973c145
commit
de5b530968
2 changed files with 12 additions and 10 deletions
9
dzgui.sh
9
dzgui.sh
|
@ -529,17 +529,20 @@ fetch_helpers_by_sum(){
|
|||
["ui.py"]="8c430f1465995cbd98f4ad8e2580a79d"
|
||||
["query_v2.py"]="1822bd1769ce7d7cb0d686a60f9fa197"
|
||||
["vdf2json.py"]="2f49f6f5d3af919bebaab2e9c220f397"
|
||||
["funcs"]="b04a0e34141e4e11da0a061802a822e3"
|
||||
["funcs"]="3aae486ae5097fa9b7349df1dfd25734"
|
||||
)
|
||||
local author="aclist"
|
||||
local repo="dztui"
|
||||
local branch="$branch"
|
||||
local url="https://raw.githubusercontent.com/$author/$repo/$branch/helpers/$file"
|
||||
local file
|
||||
local sum
|
||||
local full_path
|
||||
|
||||
for i in "${!sums[@]}"; do
|
||||
file="$i"
|
||||
sum="${sums[$i]}"
|
||||
full_path="$helpers_path/$file"
|
||||
url="https://raw.githubusercontent.com/$author/$repo/$branch/helpers/$file"
|
||||
if [[ -f "$full_path" ]] && [[ $(get_hash "$full_path") == $sum ]]; then
|
||||
logger INFO "'$file' is current"
|
||||
else
|
||||
|
@ -548,9 +551,9 @@ fetch_helpers_by_sum(){
|
|||
if [[ ! $? -eq 0 ]]; then
|
||||
raise_error_and_quit "Failed to fetch the file '$file'. Possible timeout?"
|
||||
fi
|
||||
logger INFO "Updated '$full_path' to sum '$sum'"
|
||||
fi
|
||||
[[ $file == "funcs" ]] && chmod +x "$full_path"
|
||||
logger INFO "Updated '$full_path' to sum '$sum'"
|
||||
done
|
||||
return 0
|
||||
}
|
||||
|
|
|
@ -739,7 +739,8 @@ toggle(){
|
|||
branch="stable"
|
||||
fi
|
||||
update_config
|
||||
download_new_version
|
||||
return 255
|
||||
# download_new_version
|
||||
;;
|
||||
Toggle[[:space:]]mod[[:space:]]install[[:space:]]mode)
|
||||
if [[ -z $auto_install ]]; then
|
||||
|
@ -764,6 +765,7 @@ toggle(){
|
|||
fi
|
||||
esac
|
||||
update_config
|
||||
return 90
|
||||
|
||||
}
|
||||
add_to_favs(){
|
||||
|
@ -771,6 +773,7 @@ add_to_favs(){
|
|||
ip_list+=("$record")
|
||||
update_config
|
||||
logger INFO "Added the record $record to saved servers"
|
||||
return 90
|
||||
}
|
||||
remove_from_history(){
|
||||
shift
|
||||
|
@ -799,6 +802,7 @@ remove_from_favs(){
|
|||
local cache="$(< "$_cache_my_servers")"
|
||||
<<< "$cache" grep -v -P "$r$" > $_cache_my_servers
|
||||
logger INFO "Removed the record $record from saved servers"
|
||||
return 90
|
||||
}
|
||||
update_favs_from_table(){
|
||||
local context="$1"
|
||||
|
@ -815,12 +819,6 @@ update_config(){
|
|||
[[ -z $branch ]] && branch="stable"
|
||||
mv $config_file ${config_file}.old
|
||||
write_config > $config_file
|
||||
if [[ $? -eq 0 ]]; then
|
||||
printf "Updated config file"
|
||||
return 90
|
||||
else
|
||||
return 1
|
||||
fi
|
||||
logger INFO "Updated config file at '$config_file'"
|
||||
}
|
||||
validate_ip(){
|
||||
|
@ -874,6 +872,7 @@ update_config_val(){
|
|||
declare -n nr=$key
|
||||
nr="$value"
|
||||
update_config
|
||||
return 90
|
||||
}
|
||||
show_log(){
|
||||
< "$debug_log" sed 's/Keyword␞/Keyword/'
|
||||
|
|
Loading…
Reference in a new issue