forked from Steven/NginxInstaller
When you want something done right, do it yourself...
This commit is contained in:
parent
22f1bac3c5
commit
2019c22436
14
app.js
14
app.js
@ -18,13 +18,11 @@ const service = "[Unit]\n" +
|
||||
"WantedBy=multi-user.target";
|
||||
|
||||
function generateQuickCmd() {
|
||||
let reqData = new FormData();
|
||||
reqData.append("format", "json");
|
||||
reqData.append("content", buildCmd());
|
||||
reqData.append("expires", "3600");
|
||||
reqData.append("lexer", "bash");
|
||||
let reqData = "{" +
|
||||
"\"content\":\"" + buildCmd() + "\"" +
|
||||
"}";
|
||||
|
||||
fetch("https://paste.nevets.tech/api/", {
|
||||
fetch("https://api.nevets.tech/ngx/create", {
|
||||
method: "POST",
|
||||
body: reqData,
|
||||
mode: "cors"
|
||||
@ -38,7 +36,7 @@ function buildCmd() {
|
||||
|
||||
let script = "#!/bin/bash\n" +
|
||||
"if [ \"$EUID\" -ne 0 ]\n" +
|
||||
" then echo \"Please run as root (or with sudo)\"\n" +
|
||||
"then echo \"Please run as root (or with sudo)\"\n" +
|
||||
" exit\n" +
|
||||
"fi\n\n" +
|
||||
"apt install build-essential libpcre3 libpcre3-dev zlib1g zlib1g-dev libssl-dev wget git\n" +
|
||||
@ -58,7 +56,7 @@ function buildCmd() {
|
||||
"make install\n" +
|
||||
"echo \"" + service + "\" >> /lib/systemd/system/nginx.service\n" +
|
||||
"systemctl enable nginx.service\n" +
|
||||
"systemctl start nginx.service\n";
|
||||
"systemctl start nginx.service";
|
||||
|
||||
return script;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user