Compare commits

...

4 Commits

Author SHA1 Message Date
UserA
ce1b9e5d63 Create service template 2024-08-13 05:50:36 +03:00
UserA
8e4233030e update gitignore 2024-08-13 05:50:13 +03:00
UserA
94505b324c Fix run.sh script (misshing shebang) 2024-08-13 05:49:53 +03:00
UserA
f14c8344fb Change fetch.sh script to install.sh 2024-08-13 05:49:29 +03:00
5 changed files with 33 additions and 4 deletions

2
.gitignore vendored
View File

@ -1,3 +1,5 @@
webhook
webhook.service
**.tar.gz
webhook-*-*/

View File

@ -1,3 +0,0 @@
wget https://github.com/adnanh/webhook/releases/download/2.8.1/webhook-linux-amd64.tar.gz
tar xvf webhook-linux-amd64.tar.gz
cp webhook-linux-amd64/webhook .

12
install.sh Executable file
View File

@ -0,0 +1,12 @@
scriptDir=$(dirname -- "$(readlink -f -- "$BASH_SOURCE")" | sed 's/\//\\\//g')
wget -nc https://github.com/adnanh/webhook/releases/download/2.8.1/webhook-linux-amd64.tar.gz
tar xvf webhook-linux-amd64.tar.gz
cp webhook-linux-amd64/webhook .
sed "s/RUNPATH/$scriptDir/g" webhook.service.template > webhook.service
cp webhook.service /etc/systemd/system/
systemctl daemon-reload
cp webhook /usr/bin
cp * /webhook

6
run.sh
View File

@ -1 +1,5 @@
./webhook -hooks hooks.json -verbose
#!/bin/bash
echo Start
scriptDir=$(dirname -- "$(readlink -f -- "$BASH_SOURCE")")
$scriptDir/webhook -hooks $scriptDir/hooks.json -verbose
echo End Run.sh

14
webhook.service.template Normal file
View File

@ -0,0 +1,14 @@
[Unit]
Description=Webhook
After=network-online.target
Wants=network-online.target
StartLimitIntervalSec=0
[Service]
Type=simple
Restart=always
RestartSec=1
User=root
ExecStart=RUNPATH/run.sh
[Install]
WantedBy=multi-user.target