-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9d46828
commit bee6c86
Showing
11 changed files
with
81 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,22 @@ | ||
#!/bin/bash | ||
|
||
apt-get update | ||
apt-get install -y nodejs npm | ||
sudo apt-get update | ||
ARCHITECTURE=$(dpkg --print-architecture) | ||
if [ "$ARCHITECTURE" == "amd64" ]; then | ||
USEARCH="x64" | ||
else | ||
USEARCH=$ARCHITECTURE | ||
fi | ||
wget "https://nodejs.org/download/release/v18.18.2/node-v18.18.2-linux-$USEARCH.tar.gz" | ||
tar -zxvf node-v18.18.2-linux-$USEARCH.tar.gz | ||
sudo cp -r node-v18.18.2-linux-$USEARCH/{bin,include,lib,share} /usr/ | ||
npm install -g ts-node | ||
chown -R :auto-services /opt/auto/LeekDuck/ | ||
chmod g+rwx /opt/auto/LeekDuck/ | ||
|
||
npm install -g ts-node | ||
systemctl daemon-reload | ||
systemctl enable leek-duck | ||
echo "After installation, please navigate to the project directory located at: /opt/auto/LeekDuck and run 'npm install' to install dependencies, then run 'systemctl start leek-duck' to start the service" | ||
|
||
# systemctl start leek-duck | ||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
#!/bin/bash | ||
|
||
userdel -r leek-duck | ||
if [ "$1" = "0" ]; then | ||
rm -rf /opt/auto/LeekDuck | ||
rm -f /etc/systemd/system/leek-duck.service | ||
fi | ||
|
||
systemctl daemon-reload | ||
userdel leek-duck | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
#!/bin/bash | ||
|
||
useradd --system leek-duck | ||
useradd --system --create-home --home-dir /home/leek-duck leek-duck | ||
groupadd auto-services | ||
usermod -a -G auto-services leek-duck | ||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
#!/bin/bash | ||
systemctl stop leek-duck | ||
systemctl disable leek-duck | ||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[Unit] | ||
Description=LeekDuck Service for | ||
|
||
[Service] | ||
Type=simple | ||
User=leek-duck | ||
Group=auto-services | ||
WorkingDirectory=/opt/auto/LeekDuck/ | ||
ExecStart=/usr/bin/ts-node /opt/auto/LeekDuck/index.ts | ||
Restart=on-failure | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters