Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installer: add support for algoh to systemd installs #6102

Merged
merged 1 commit into from
Aug 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading