Use token from environment variable
This commit is contained in:
parent
9c12e3d800
commit
548dc03a78
1 changed files with 3 additions and 3 deletions
|
@ -119,13 +119,13 @@ mkdir -p /etc/netweak
|
||||||
mkdir -p /etc/netweak/log
|
mkdir -p /etc/netweak/log
|
||||||
|
|
||||||
# Download agent
|
# Download agent
|
||||||
echo -e "| Downloading agent.sh to /etc/netweak\n|\n| + $(curl -JLso /etc/netweak/agent.sh https://github.com/netweak/agent/raw/main/agent.sh)"
|
echo -e "| Downloading agent.sh to /etc/netweak\n|\n| + $(curl -JLso /etc/netweak/agent.sh https://ark.sudovanilla.org/Korbs/netweak-agent/raw/branch/main/agent.sh)"
|
||||||
echo -e "| Downloading heartbeat.sh to /etc/netweak\n|\n| + $(curl -JLso /etc/netweak/heartbeat.sh https://github.com/netweak/agent/raw/main/heartbeat.sh)"
|
echo -e "| Downloading heartbeat.sh to /etc/netweak\n|\n| + $(curl -JLso /etc/netweak/heartbeat.sh https://ark.sudovanilla.org/Korbs/netweak-agent/raw/branch/main/heartbeat.sh)"
|
||||||
|
|
||||||
if [ -f /etc/netweak/agent.sh ]
|
if [ -f /etc/netweak/agent.sh ]
|
||||||
then
|
then
|
||||||
# Create auth file
|
# Create auth file
|
||||||
echo "$1" > /etc/netweak/token.conf
|
echo $(env | grep TOKEN | grep -oe '[^=]*$'); > /etc/netweak/token.conf
|
||||||
|
|
||||||
# Create user
|
# Create user
|
||||||
useradd netweak -r -d /etc/netweak -s /bin/false
|
useradd netweak -r -d /etc/netweak -s /bin/false
|
||||||
|
|
Loading…
Reference in a new issue