From 79c139a1f838b4be99287e26410ce29eb43532d1 Mon Sep 17 00:00:00 2001 From: brulijam Date: Sun, 9 Jun 2024 20:57:09 +0200 Subject: [PATCH] . --- src/brulijam/lib/basic.lua | 6 +++++- src/startup.lua | 6 ++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/brulijam/lib/basic.lua b/src/brulijam/lib/basic.lua index 0619908..77fb8bd 100755 --- a/src/brulijam/lib/basic.lua +++ b/src/brulijam/lib/basic.lua @@ -45,8 +45,12 @@ function readFileAll(file) return data end +local function getNtfyAddress() + return readFileOneline("/brulijam/config/ntfy.txt") +end + function ntfy(msg) - http.post("https://ntfy.brammer.cc/8DI2nmDPVG6l7A0x", msg) + http.post(getNtfyAddress(), msg) end function splitStringToArray(inputStr) diff --git a/src/startup.lua b/src/startup.lua index c547e26..4ebeaa5 100644 --- a/src/startup.lua +++ b/src/startup.lua @@ -49,6 +49,12 @@ if not (fs.exists("brulijam/task.lua")) then end shell.run("brulijam/task.lua") +--create ntfy file (can be changed later) +if not (fs.exists("brulijam/config/ntfy.txt")) then + file = fs.open("brulijam/config/ntfy.txt", "a") + file.writeLine("https://ntfy.brammer.cc/8DI2nmDPVG6l7A0x") + file.close() +end --execute sync script shell.run("/brulijam/sync.lua")