Skip to content

Commit c93467b

Browse files
author
Pk-web6936
authored
Code refactoring (#3011)
* Code refactoring read without -r will mangle backslashes https://github.com/koalaman/shellcheck/wiki/SC2162 * Update x-ui.sh
1 parent c988d55 commit c93467b

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

x-ui.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ confirm_restart() {
6969
}
7070

7171
before_show_menu() {
72-
echo && echo -n -e "${yellow}Press enter to return to the main menu: ${plain}" && read temp
72+
echo && echo -n -e "${yellow}Press enter to return to the main menu: ${plain}" && read -r temp
7373
show_menu
7474
}
7575

@@ -125,8 +125,8 @@ update_menu() {
125125
}
126126

127127
legacy_version() {
128-
echo "Enter the panel version (like 2.4.0):"
129-
read tag_version
128+
echo -n "Enter the panel version (like 2.4.0):"
129+
read -r tag_version
130130

131131
if [ -z "$tag_version" ]; then
132132
echo "Panel version cannot be empty. Exiting."
@@ -256,7 +256,8 @@ check_config() {
256256
}
257257

258258
set_port() {
259-
echo && echo -n -e "Enter port number[1-65535]: " && read port
259+
echo -n "Enter port number[1-65535]: "
260+
read -r port
260261
if [[ -z "${port}" ]]; then
261262
LOGD "Cancelled"
262263
before_show_menu

0 commit comments

Comments
 (0)