fixing customizable make username problems

This commit is contained in:
Saxon Nelson-Milton 2022-05-27 12:44:18 +09:30
parent e894abe339
commit ab49930149
3 changed files with 9 additions and 9 deletions

View File

@ -38,8 +38,8 @@ as_root:
ifneq ($(USER),root)
$(error Must run as superuser!)
endif
sed -i 's/pi/$(USR)/' rv.service
sed -i 's/pi/$(USR)/' run.sh
sed -i 's/<user>/$(USR)/' rv.service
sed -i 's/<user>/$(USR)/' run.sh
make_dirs:
if [ ! -d /var/netsender ] ; then \

View File

@ -1,13 +1,13 @@
#!/bin/sh -e
# This script launches rv on a pi, intended to run at boot time.
# This script launches rv on a <user>, intended to run at boot time.
RVPATH=/home/pi/go/src/bitbucket.org/ausocean/av/cmd/rv
RVPATH=/home/<user>/go/src/bitbucket.org/ausocean/av/cmd/rv
echo Set kernel parameters:
# kernel settings to improve performance on Raspberry Pi
# tell Linux to fork optimistically
sudo sysctl -w vm.overcommit_memory=1
# minimize swapping, without disabling it completely
# minimize swap<user>ng, without disabling it completely
sudo sysctl -w vm.swappiness=1
# the following required directories _should_ already exist
@ -28,13 +28,13 @@ sudo ip addr show | grep inet
exec 2> /var/log/netsender/stream.log
exec 1>&2
# set env, working dir and run rv as pi user
HOME=/home/pi
# set env, working dir and run rv as <user> user
HOME=/home/<user>
GOPATH=$HOME/go
RVPATH=$GOPATH/src/bitbucket.org/ausocean/av/cmd/rv
PATH=$PATH:/usr/local/go/bin:$RVPATH
cd $RVPATH
sudo -u pi HOME=$HOME GOPATH=$GOPATH PATH=$PATH ./rv
sudo -u <user> HOME=$HOME GOPATH=$GOPATH PATH=$PATH ./rv
if [ $? -eq 0 ]
then
echo "Successfully exited rv"

View File

@ -3,7 +3,7 @@ Description=Netsender Client for Media Collection and Forwarding
[Service]
Type=simple
ExecStart=/home/pi/go/src/bitbucket.org/ausocean/av/init/run.sh
ExecStart=/home/<user>/go/src/bitbucket.org/ausocean/av/init/run.sh
Restart=on-failure
[Install]