-
Notifications
You must be signed in to change notification settings - Fork 470
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Installer: add support for algoh to systemd installs (#6102)
- Loading branch information
1 parent
3b9f3e3
commit 8e2e2e4
Showing
2 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|