Remade makefile, fixed symlink bug in justfile, simplified servicefile, updated README

This commit is contained in:
2026-06-20 21:43:48 -04:00
parent ae02c9dfc0
commit d487590e28
5 changed files with 106 additions and 61 deletions
+22 -11
View File
@@ -33,26 +33,37 @@ ins_server:
if [[ $PORT -ne "" ]]; then
sed -i -e "s/1300/$PORT/" server.go
fi
echo "go build server.go"
go build server.go
echo "go build -o ekho_server server.go"
go build -o ekho_server server.go
echo "mv ekho_server /usr/local/bin/"
mv ekho_server /usr/local/bin/
USER=($(users))
sed -i -e "s/^User=/User=${USER[0]}/" ekho.service
sed -i -e "s/^WorkingDirectory=.*/WorkingDirectory=\/home\/${USER[0]}\//" ekho.service
echo "sudo mv server /usr/local/bin/server"
sudo mv server /usr/local/bin/server
echo "sudo mv ekho.service /etc/systemd/system/"
sudo mv ekho.service /etc/systemd/system/
sed -i -e "s/USER/${USER[0]}/" ekho.service
echo "cp ekho.service /etc/systemd/system/"
cp ekho.service /etc/systemd/system/
mkdir -p ~/.config/ekho
echo "ln -s -r ./list.q ~/.config/ekho/list.q"
ln -s -r ./list.q ~/.config/ekho/list.q
echo "systemctl daemon-reload"
systemctl daemon-reload
echo "systemctl enable ekho"
systemctl enable ekho
echo "systemctl start ekho"
systemctl start ekho
echo "systemctl status ekho"
systemctl status ekho
# install client
ins_client:
#!/usr/bin/bash
echo "enter ip and port of server, 'aaa.bbb.ccc.ddd:port"
echo "enter url or ip and port of server, 'aaa.bbb.ccc.ddd:port"
read IP_PORT
sed -i -e "s/:1300/$IP_PORT/" client.go
echo "go build -o ekho client.go"
go build -o ekho client.go
sed -i -e "s/$IP_PORT/:1300/" client.go
echo "sudo mv ekho /usr/local/bin/"
sudo mv ekho /usr/local/bin/
echo "mv ekho /usr/local/bin/"
mv ekho /usr/local/bin/
echo "add 'ekho' to shell config (config.fish, .bashrc, etc)"