Skip to content

Commit

Permalink
Installer: add support for algoh to systemd installs (#6102)
Browse files Browse the repository at this point in the history
  • Loading branch information
onetechnical authored Aug 15, 2024
1 parent 3b9f3e3 commit 8e2e2e4
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
18 changes: 18 additions & 0 deletions cmd/updater/systemd-setup-user.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,27 @@ setup_user() {
sed -e s,@@BINDIR@@,"$bindir", "${SCRIPTPATH}/[email protected]" \
> "$homedir/.config/systemd/user/[email protected]"

if [[ ${HOSTMODE} == true ]]; then
echo "[INFO] Hosted mode - replacing algod with algoh"
sed -i 's/algod/algoh/g' "$homedir/.config/systemd/user/[email protected]"
fi

systemctl --user daemon-reload
}

HOSTMODE=false
while getopts H opt; do
case $opt in
H)
HOSTMODE=true
;;
?)
echo "Invalid option: -${OPTARG}"
exit 1
;;
esac
done
shift $((OPTIND-1))

if [ "$#" != 1 ]; then
echo "Usage: $0 username"
Expand Down
19 changes: 19 additions & 0 deletions cmd/updater/systemd-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,28 @@ setup_root() {
sed ${sedargs} "${SCRIPTPATH}/[email protected]" \
> /lib/systemd/system/[email protected]

if [[ ${HOSTMODE} == true ]]; then
echo "[INFO] Hosted mode - replacing algod with algoh"
sed -i 's/algod/algoh/g' /lib/systemd/system/[email protected]
fi

systemctl daemon-reload
}

HOSTMODE=false
while getopts H opt; do
case $opt in
H)
HOSTMODE=true
;;
?)
echo "Invalid option: -${OPTARG}"
exit 1
;;
esac
done
shift $((OPTIND-1))

if [ "$#" != 2 ] && [ "$#" != 3 ]; then
echo "Usage: $0 username group [bindir]"
exit 1
Expand Down

0 comments on commit 8e2e2e4

Please sign in to comment.