wip: implementing install script

pull/237/head
LouisLam 3 years ago
parent 61944d642e
commit bb0af35d47

@ -1,13 +1,15 @@
// install.sh is generated by ./extra/install.batsh, do not modify it directly.
// "npm run compile-install-script" to compile install.sh
// The command is working on Windows PowerShell and Docker for Windows only.
// curl -o uptime-kuma-install.sh https://raw.githubusercontent.com/louislam/uptime-kuma/master/install.sh && sudo bash uptime-kuma-install.sh
println("=====================");
println("Uptime Kuma Installer");
println("=====================");
println("");
println("Supported OS: CentOS 7/8, Ubuntu >= 16.04 and Debian");
println("---------------------------------------");
println("This script is designed for Linux and basic usage.");
println("Supported OS: CentOS 7/8, Ubuntu >= 16.04 and Debian");
println("For advanced usage, please go to https://github.com/louislam/uptime-kuma/wiki/Installation");
println("---------------------------------------");
println("");
@ -104,7 +106,7 @@ if (type == "local") {
if ("$3" != "") {
port = "$3";
} else {
call("read", "-p", "Listening Port [$port]: ", "port");
call("read", "-p", "Listening Port [$defaultPort]: ", "port");
if (port == "") {
port = defaultPort;
@ -114,7 +116,7 @@ if (type == "local") {
if ("$2" != "") {
installPath = "$2";
} else {
call("read", "-p", "Installation Path [$installPath]: ", "installPath");
call("read", "-p", "Installation Path [$defaultInstallPath]: ", "installPath");
if (installPath == "") {
installPath = defaultInstallPath;
@ -210,7 +212,7 @@ if (type == "local") {
if ("$3" != "") {
port = "$3";
} else {
call("read", "-p", "Expose Port [$port]: ", "port");
call("read", "-p", "Expose Port [$defaultPort]: ", "port");
if (port == "") {
port = defaultPort;
@ -232,3 +234,5 @@ if (type == "local") {
bash("docker volume create $volume");
bash("docker run -d --restart=always -p $port:3001 -v $volume:/app/data --name uptime-kuma louislam/uptime-kuma:1");
}
println("http://localhost:$port");

@ -1,13 +1,13 @@
# install.sh is generated by ./extra/install.batsh, do not modify it directly.
# "npm run compile-install-script" to compile install.sh
# The command is working on Windows PowerShell and Docker for Windows only.
# curl -o uptime-kuma-install.sh https://raw.githubusercontent.com/louislam/uptime-kuma/master/install.sh && sudo bash uptime-kuma-install.sh
"echo" "-e" "====================="
"echo" "-e" "Uptime Kuma Installer"
"echo" "-e" "====================="
"echo" "-e" ""
"echo" "-e" "Supported OS: CentOS 7/8, Ubuntu >= 16.04 and Debian"
"echo" "-e" "---------------------------------------"
"echo" "-e" "This script is designed for Linux and basic usage."
"echo" "-e" "Supported OS: CentOS 7/8, Ubuntu >= 16.04 and Debian"
"echo" "-e" "For advanced usage, please go to https://github.com/louislam/uptime-kuma/wiki/Installation"
"echo" "-e" "---------------------------------------"
"echo" "-e" ""
@ -89,7 +89,7 @@ fi
if [ "$3" != "" ]; then
port="$3"
else
"read" "-p" "Listening Port [$port]: " "port"
"read" "-p" "Listening Port [$defaultPort]: " "port"
if [ "$port" == "" ]; then
port="$defaultPort"
fi
@ -97,7 +97,7 @@ fi
if [ "$2" != "" ]; then
installPath="$2"
else
"read" "-p" "Installation Path [$installPath]: " "installPath"
"read" "-p" "Installation Path [$defaultInstallPath]: " "installPath"
if [ "$installPath" == "" ]; then
installPath="$defaultInstallPath"
fi
@ -177,7 +177,7 @@ fi
if [ "$3" != "" ]; then
port="$3"
else
"read" "-p" "Expose Port [$port]: " "port"
"read" "-p" "Expose Port [$defaultPort]: " "port"
if [ "$port" == "" ]; then
port="$defaultPort"
fi
@ -195,3 +195,4 @@ fi
docker volume create $volume
docker run -d --restart=always -p $port:3001 -v $volume:/app/data --name uptime-kuma louislam/uptime-kuma:1
fi
"echo" "-e" "http://localhost:$port"

Loading…
Cancel
Save