mirror of
https://github.com/billz/raspap-webgui.git
synced 2023-10-10 13:37:24 +02:00
Update installer with version option
This commit is contained in:
parent
9735c97795
commit
89e9fc5563
@ -11,13 +11,20 @@
|
|||||||
# Installs mkcert and generates an SSL certificate for lighttpd
|
# Installs mkcert and generates an SSL certificate for lighttpd
|
||||||
# -o, --openvpn <flag>
|
# -o, --openvpn <flag>
|
||||||
# Used with -y, --yes, sets OpenVPN install option (0=no install)
|
# Used with -y, --yes, sets OpenVPN install option (0=no install)
|
||||||
# # -r, --repo, --repository <name>
|
# -r, --repo, --repository <name>
|
||||||
# Overrides the default GitHub repo (billz/raspap-webgui)
|
# Overrides the default GitHub repo (billz/raspap-webgui)
|
||||||
# -b, --branch <name>
|
# -b, --branch <name>
|
||||||
# Overrides the default git branch (master)
|
# Overrides the default git branch (master)
|
||||||
|
# -h, --help
|
||||||
|
# Outputs usage notes and exits
|
||||||
|
# -v, --version
|
||||||
|
# Outputs release info and exits
|
||||||
|
|
||||||
|
VERSION=$(curl -s "https://api.github.com/repos/$repo/releases/latest" | grep -Po '"tag_name": "\K.*?(?=")' )
|
||||||
repo="billz/raspap-webgui"
|
repo="billz/raspap-webgui"
|
||||||
branch="master"
|
branch="master"
|
||||||
|
assume_yes=0
|
||||||
|
ovpn_option=1
|
||||||
usage=$(cat << EOF
|
usage=$(cat << EOF
|
||||||
Usage: raspbian.sh [OPTION]\n
|
Usage: raspbian.sh [OPTION]\n
|
||||||
-y, --yes, --assume-yes\n\tAssumes "yes" as an answer to all prompts
|
-y, --yes, --assume-yes\n\tAssumes "yes" as an answer to all prompts
|
||||||
@ -25,11 +32,10 @@ Usage: raspbian.sh [OPTION]\n
|
|||||||
-o, --openvpn <flag>\n\tUsed with -y, --yes, sets OpenVPN install option (0=no install)
|
-o, --openvpn <flag>\n\tUsed with -y, --yes, sets OpenVPN install option (0=no install)
|
||||||
-r, --repo, --repository <name>\n\tOverrides the default GitHub repo (billz/raspap-webgui)
|
-r, --repo, --repository <name>\n\tOverrides the default GitHub repo (billz/raspap-webgui)
|
||||||
-b, --branch <name>\n\tOverrides the default git branch (master)
|
-b, --branch <name>\n\tOverrides the default git branch (master)
|
||||||
-h, --help\n\tOutputs usage notes\n
|
-h, --help\n\tOutputs usage notes and exits
|
||||||
|
-v, --version\n\tOutputs release info and exits\n
|
||||||
EOF
|
EOF
|
||||||
)
|
)
|
||||||
assume_yes=0
|
|
||||||
ovpn_option=1
|
|
||||||
|
|
||||||
while :; do
|
while :; do
|
||||||
case $1 in
|
case $1 in
|
||||||
@ -56,6 +62,11 @@ while :; do
|
|||||||
printf "$usage"
|
printf "$usage"
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
|
-v|--version)
|
||||||
|
printf "RaspAP v${VERSION} - simple AP setup and wifi mangement for the RaspberryPi\n"
|
||||||
|
printf "Licensed under GPL-3.0, BillZ <billzimmerman@gmail.com> and contributors\n"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
-*|--*)
|
-*|--*)
|
||||||
echo "Unknown option: $1"
|
echo "Unknown option: $1"
|
||||||
printf "$usage"
|
printf "$usage"
|
||||||
@ -68,7 +79,6 @@ while :; do
|
|||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
|
|
||||||
VERSION=$(curl -s "https://api.github.com/repos/$repo/releases/latest" | grep -Po '"tag_name": "\K.*?(?=")' )
|
|
||||||
UPDATE_URL="https://raw.githubusercontent.com/$repo/$branch/"
|
UPDATE_URL="https://raw.githubusercontent.com/$repo/$branch/"
|
||||||
|
|
||||||
# Outputs a welcome message
|
# Outputs a welcome message
|
||||||
|
Loading…
Reference in New Issue
Block a user