go-daemon/c-daemon/tmp-install.sh

31 lines
783 B
Bash
Raw Normal View History

2023-07-27 12:22:51 +03:00
#!/bin/bash
# Temporary Install file for testing until binary installation packages are ready
### C-daemon
# Pre-Cleaning
2023-07-27 12:22:51 +03:00
sudo rm /usr/bin/cdaemontmp
sudo rm -rf /usr/lib/cdaemontmp/
# Building
temp_dir="$(mktemp -d)"
cd $temp_dir
echo $temp_dir
2023-07-27 12:22:51 +03:00
git clone https://git.aliberksandikci.com.tr/liderahenk/go-daemon
cd go-daemon/
go build -o c-daemon/bin/ c-daemon/go-files/info.go
gcc -o c-daemon/bin/test c-daemon/daemon/test.c c-daemon/daemon/daemon.c
# Installing
cd c-daemon
2023-07-27 12:32:25 +03:00
sudo mv ./bin/test /usr/bin/cdaemontmp
sudo mkdir -p /usr/lib/cdaemontmp/
sudo mv ./bin/info /usr/lib/cdaemontmp/info
sudo mv ./cdaemontmp.service /etc/systemd/system/
2023-07-29 11:33:03 +03:00
sudo systemctl daemon-reload
sudo systemctl enable cdaemontmp
sudo systemctl start cdaemontmp
# Post-Cleaning
2023-07-27 13:54:15 +03:00
sudo rm -rf $temp_dir