Changed installation instructions to append to .bashrc

This commit is contained in:
Alex
2023-11-30 11:01:51 -05:00
committed by GitHub
parent 8651b59e67
commit e38fb2b091
+11 -17
View File
@@ -34,27 +34,20 @@ If both binaries are being run on the same machine, ```make all``` will suffice.
``` sh ``` sh
make all make all
``` ```
At this point, the user should feel free to change the names of the Bash scripts and binaries as they see fit, making sure to update the calls inside the Bash scripts as necessary.
The client binary needs to run on login, the directory on the Raspberry Pi where these scripts go is ```/etc/update-motd.d/```. #### NOTE
``` sh In previous versions, the suggested method of installation involved placing bash scripts in ```/etc/update-motd.d/```, however, there have been issues getting that installation method working (namely, having MOTD run user-defined commands), and the current quick and extremely dirty suggested installation method is to just append the user's shell config files (```.bashrc```, ```.bash_profile```, ```.zshrc```, etc) with the paths to the executables.
sudo chmod u+x quote-run.sh
sudo mv quote-run.sh /etc/update-motd.d/01-quote-run
```
The server binary and complementary script need to be running at all times. Should they be run on a distinct machine, this is also the time to move them, as well as the list of quotes they pull from.
``` sh
scp server.go user@ip:~/path/to/file/
scp server-run.sh user@ip:~/path/to/file/
scp list.q user@ip:~/path/to/file/
```
On that machine, the server will need to be compiled, so the makefile can be copied with ```scp``` just the same, or compiled using ```go build```. It is important that list.q is in the same directory as the go binary.
From there, on the server machine, to avoid inconvenient server crashes, move the server script, just like the client script. For example, if the server used zsh, the installation could look something like this:
``` sh ``` sh
sudo chmod u+x server-run.sh echo "~/abs/path/to/server.o &" >> ~/.zshrc
sudo mv server-run.sh /etc/update-motd.d/01-server-run
``` ```
This installation method requires the user to be logged in at all times, and will run multiple instances should the same user log in multiple times, so it is recommended to have a either have a main user that never logs out, or a dummy user that auto-logs in on reboot. (If someone knows a better way to have one instance of the software always run, please let me know) Similarly for a client using Bash:
``` sh
echo "~/abs/path/to/client.o" >> ~/.bashrc
```
Any help figuring out the issue with MOTD would be appreciated.
Finally done! Finally done!
### Usage ### Usage
@@ -71,5 +64,6 @@ The client uses the following flags
- Log all uses/transaction data each day - Log all uses/transaction data each day
- Request, send, and receive the logfile for any day - Request, send, and receive the logfile for any day
- User-specific quotes/quotefiles - User-specific quotes/quotefiles
- Installation (client-side, at least) via MOTD
[golang]: <https://go.dev/doc/install> [golang]: <https://go.dev/doc/install>