Update install-frps.sh

This commit is contained in:
mvscode
2024-07-24 14:22:29 +08:00
committed by GitHub
parent 40b2dc00b3
commit 09075d7465

View File

@@ -268,13 +268,13 @@ fun_download_file(){
# download
if [ ! -s ${str_program_dir}/${program_name} ]; then
rm -fr ${program_latest_filename} frp_${FRPS_VER}_linux_${ARCHS}
echo -e "Downloading ${program_name}..."
echo ""
echo -e "Downloading ${program_name}..."
echo ""
curl -L --progress-bar "${program_latest_file_url}" -o "${program_latest_filename}" 2>&1 | show_progress
echo ""
echo ""
if [ $? -ne 0 ]; then
echo -e " ${COLOR_RED}Download failed${COLOR_END}"
exit 1
exit 1
fi
# Verify the downloaded file exists and is not empty
@@ -283,7 +283,7 @@ fun_download_file(){
exit 1
fi
echo -e "Extracting ${program_name}..."
echo ""
echo ""
tar xzf ${program_latest_filename}
mv frp_${FRPS_VER}_linux_${ARCHS}/frps ${str_program_dir}/${program_name}
@@ -322,16 +322,16 @@ show_progress() {
printf "\r${GREEN}%2d%% [" "$PERCENTAGE"
for ((i = 0; i < completed; i++)); do
if [ $i -eq $((completed - 1)) ]; then
if [ $i -eq $((completed - 1)) ]; then
printf ">"
else
printf "="
fi
done
printf "="
fi
done
for ((i = 0; i < remaining; i++)); do
printf " "
done
printf "]${NC}"
printf "]${NC}"
CURRENT_SIZE=$((CURRENT_SIZE + $((RANDOM % 50000 + 1))))
sleep 0.05