Files: 99632759931138b75a0c377236b80bbe2042a18d / geninvitecodepage.sh
759 bytesRaw
1 | |
2 | invite_code=${1?invite_code} |
3 | config_file=${2:-config.ps} |
4 | if [ ! -s "$config_file" ]; then |
5 | printf "missing config file %s\n" "$config_file" >&2 |
6 | exit 1 |
7 | fi |
8 | |
9 | invite_code="$(printf "%s" "$invite_code" | sed 's/\//\\\//g')" |
10 | op_name="$(grep op_name "$config_file" | sed 's/.*\?(//; s/).*\?//; s/\//\\\//g')" |
11 | op_id="$(grep op_id "$config_file" | grep -o @.*ed25519 | sed 's/\//\\\//g')" |
12 | pub_name="$(grep pub_name "$config_file" | sed 's/.*\?(//; s/).*\?//; s/\//\\\//g')" |
13 | pub_id="$(grep pub_id "$config_file" | grep -o @.*ed25519 | sed 's/\//\\\//g')" |
14 | exec sed -e "s/{{invite_code}}/$invite_code/g" \ |
15 | -e "s/{{op_name}}/$op_name/g" \ |
16 | -e "s/{{op_id}}/$op_id/g" \ |
17 | -e "s/{{pub_name}}/$pub_name/g" \ |
18 | -e "s/{{pub_id}}/$pub_id/g" \ |
19 | invite.html |
20 |
Built with git-ssb-web