--port novalue stop

This commit is contained in:
qiaofeng1227 2023-11-24 14:57:27 +08:00
parent 29924ad1be
commit 00a45147b6
2 changed files with 47 additions and 14 deletions

View file

@ -45,27 +45,53 @@ path="/data/websoft9/source"
while [[ $# -gt 0 ]]; do
case $1 in
--version)
version="$2"
shift 2
shift
if [[ $1 == --* ]]; then
echo "Missing value for --version"
exit 1
fi
version="$1"
shift
;;
--port)
port="$2"
shift 2
shift
if [[ $1 == --* ]]; then
echo "Missing value for --port"
exit 1
fi
port="$1"
shift
;;
--channel)
channel="$2"
shift 2
shift
if [[ $1 == --* ]]; then
echo "Missing value for --channel"
exit 1
fi
channel="$1"
shift
;;
--path)
path="$2"
shift 2
shift
if [[ $1 == --* ]]; then
echo "Missing value for --path"
exit 1
fi
path="$1"
shift
;;
--devto)
devto="$2"
shift 2
shift
if [[ $1 == --* ]]; then
echo "Missing value for --devto"
exit 1
fi
devto="$1"
shift
;;
*)
shift
echo "Unknown parameter: $1"
exit 1
;;
esac
done

View file

@ -30,14 +30,21 @@ export PATH
echo -e "\n\n-------- Cockpit --------"
# 获取参数值
while [[ $# -gt 0 ]]; do
case $1 in
--port)
port="$2"
shift 2
shift
if [[ $1 == --* ]]; then
echo "Missing value for --port"
exit 1
fi
port="$1"
shift
;;
*)
shift
echo "Unknown parameter: $1"
exit 1
;;
esac
done