2017-12-31 05:28:03 +01:00
|
|
|
# Build and Installation
|
|
|
|
|
|
|
|
## go
|
|
|
|
|
|
|
|
### Install
|
|
|
|
```sh
|
|
|
|
cd /usr/local/
|
2019-10-12 21:58:14 +02:00
|
|
|
wget https://dl.google.com/go/go1.13.1.linux-amd64.tar.gz -O go-release-linux-amd64.tar.gz
|
2017-12-31 05:28:03 +01:00
|
|
|
tar xvf go-release-linux-amd64.tar.gz
|
|
|
|
rm go-release-linux-amd64.tar.gz
|
|
|
|
```
|
|
|
|
|
|
|
|
### Configure go
|
|
|
|
Add these lines in your root shell startup file (e.g. `/root/.bashrc`):
|
|
|
|
```sh
|
|
|
|
export GOPATH=/opt/go
|
|
|
|
export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin
|
|
|
|
```
|
|
|
|
|
|
|
|
## Yanic
|
|
|
|
|
|
|
|
### Compile
|
|
|
|
As root:
|
|
|
|
```sh
|
|
|
|
go get -v -u github.com/FreifunkBremen/yanic
|
|
|
|
```
|
|
|
|
|
|
|
|
### Install
|
|
|
|
|
|
|
|
```sh
|
|
|
|
cp /opt/go/src/github.com/FreifunkBremen/yanic/contrib/init/linux-systemd/yanic.service /lib/systemd/system/yanic.service
|
|
|
|
systemctl daemon-reload
|
|
|
|
```
|
|
|
|
|
2018-01-13 16:54:48 +01:00
|
|
|
Before start, you should configure yanic by the file `/etc/yanic.conf`:
|
2019-10-13 10:48:44 +02:00
|
|
|
```sh
|
2017-12-31 05:28:03 +01:00
|
|
|
systemctl start yanic
|
|
|
|
```
|
|
|
|
|
|
|
|
Enable to start on boot:
|
2019-10-13 10:48:44 +02:00
|
|
|
```sh
|
2017-12-31 05:28:03 +01:00
|
|
|
systemctl enable yanic
|
|
|
|
```
|
|
|
|
|
|
|
|
### Update
|
|
|
|
For an update just stop yanic and then call the same `go` command again (again as root):
|
|
|
|
```sh
|
|
|
|
systemctl stop yanic
|
|
|
|
go get -v -u github.com/FreifunkBremen/yanic
|
|
|
|
```
|
|
|
|
Then update the config file, for example look at the diff with the new example:
|
|
|
|
```sh
|
|
|
|
diff /opt/go/src/github.com/FreifunkBremen/yanic/config_example.toml /etc/yanic.conf
|
|
|
|
```
|