Skip to content

Commit

Permalink
sed is really nice
Browse files Browse the repository at this point in the history
  • Loading branch information
traceypooh committed Mar 13, 2024
1 parent 46fa5ac commit be254af
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions bin/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ if [ ! $FIRST ]; then
[ "$?" = "0" ] && break
set -e

( fgrep 'ACL bootstrap already done' /tmp/boot.log ) && break
( grep -F 'ACL bootstrap already done' /tmp/boot.log ) && break
sleep 1
done
set -e

consul keygen | tr -d '^\n' | podman secret create HIND_C -
nomad operator gossip keyring generate | tr -d '^\n' | podman secret create HIND_N -

export NOMAD_TOKEN=$(fgrep 'Secret ID' /tmp/bootstrap |cut -f2- -d= |tr -d ' ')
export NOMAD_TOKEN=$(grep -F 'Secret ID' /tmp/bootstrap |cut -f2- -d= |tr -d ' ')
echo -n $NOMAD_TOKEN | podman secret create NOMAD_TOKEN -

rm -f /tmp/bootstrap
Expand Down Expand Up @@ -90,7 +90,7 @@ FI=/lib/systemd/system/systemd-networkd.socket
if [ -e $FI ]; then
# workaround focal-era bug after ~70 deploys (and thus 70 "veth" interfaces)
# https://www.mail-archive.com/[email protected]/msg5888501.html
sed -i '' -e 's^ReceiveBuffer=.*$^ReceiveBuffer=256M^' $FI
sed -i 's^ReceiveBuffer=.*$^ReceiveBuffer=256M^' $FI
fi


Expand Down
4 changes: 2 additions & 2 deletions bin/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ if [ ! -e /opt/nomad/data/plugins ]; then
exit 0
fi

sed -i '' -e "s^VEhJUy1HRVRTLVJFUExBQ0VELUlULURPRVMtUklMTFk=^$HIND_C^" $CONSUL_HCL
sed -i '' -e "s^VEhJUy1HRVRTLVJFUExBQ0VELUlULURPRVMtUklMTFk=^$HIND_N^" $NOMAD_HCL
sed -i "s^VEhJUy1HRVRTLVJFUExBQ0VELUlULURPRVMtUklMTFk=^$HIND_C^" $CONSUL_HCL
sed -i "s^VEhJUy1HRVRTLVJFUExBQ0VELUlULURPRVMtUklMTFk=^$HIND_N^" $NOMAD_HCL

# set for `nomad run` of jobs with `podman` driver
podman system service -t 0 & # xxx prolly add into supervisord for autorestart
Expand Down

0 comments on commit be254af

Please sign in to comment.