wip: implementing install script

This commit is contained in:
LouisLam
2021-08-19 02:38:45 +08:00
parent 61944d642e
commit bb0af35d47
2 changed files with 15 additions and 10 deletions

View File

@@ -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");