Closed sleepdefic1t closed 6 years ago
This update adds support for all home-directory usernames.
Missing directory errors
Default packages point to /home/pi/...
/home/pi/...
If username is other than pi; install.sh, uninstall.sh, & /scripts/subnodes_ap.sh will throw missing directory errors.
pi
install.sh
uninstall.sh
/scripts/subnodes_ap.sh
Install, run, and be uninstalled with no directory errors.
Have username other than pi
cd subnodes sudo bash install.sh || sudo ./install.sh
cd subnodes
sudo bash install.sh
sudo ./install.sh
replace: cd /home/pi/subnodes/
cd /home/pi/subnodes/
with: cd "$(dirname $(readlink -f $0))"
cd "$(dirname $(readlink -f $0))"
/subnodes/install.sh#L152
#
replace:
cd /home/pi/
rm -rf /home/pi/subnodes
with:
cd "$(dirname "$(pwd)")"
rm -rf subnodes
/subnodes/uninstall.sh#L76 /subnodes/uninstall.sh#L77
replace: DAEMON_PATH="/home/pi/subnodes"
DAEMON_PATH="/home/pi/subnodes"
with: DAEMON_PATH="$(dirname "$(pwd)")"
DAEMON_PATH="$(dirname "$(pwd)")"
/subnodes/scripts/subnodes_ap.sh#L19
No missing directory errors. subnodes installs as expected.
Thank you!
This update adds support for all home-directory usernames.
Issue
Missing directory errors
Cause
Default packages point to
/home/pi/...
If username is other than
pi
;install.sh
,uninstall.sh
, &/scripts/subnodes_ap.sh
will throw missing directory errors.Expected result
Install, run, and be uninstalled with no directory errors.
Reproduction
Have username other than
pi
cd subnodes
sudo bash install.sh
||sudo ./install.sh
Suggested Fix
replace:
cd /home/pi/subnodes/
with:
cd "$(dirname $(readlink -f $0))"
/subnodes/install.sh#L152
#
replace:
cd /home/pi/
rm -rf /home/pi/subnodes
with:
cd "$(dirname "$(pwd)")"
rm -rf subnodes
/subnodes/uninstall.sh#L76
/subnodes/uninstall.sh#L77
#
replace:
DAEMON_PATH="/home/pi/subnodes"
with:
DAEMON_PATH="$(dirname "$(pwd)")"
/subnodes/scripts/subnodes_ap.sh#L19
#
Results after Suggested Fix
No missing directory errors. subnodes installs as expected.