-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcli_tools.sh
More file actions
56 lines (47 loc) · 1.46 KB
/
Copy pathcli_tools.sh
File metadata and controls
56 lines (47 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/usr/bin/env bash
set -euo pipefail
. src/cli_tools/aws.sh
. src/cli_tools/github.sh
. src/cli_tools/hasura.sh
. src/cli_tools/mysql.sh
. src/cli_tools/postgres.sh
provision_setup_cli_tools() {
if [ -f "$PROVISION_CONFIG"/cli-vercel ]; then
install_node_modules vercel
fi
if type iredis >/dev/null 2>&1; then
cp ~/development/environment/src/config-files/iredisrc ~/.iredisrc
fi
# https://nixos.wiki/wiki/OpenVPN
if [ -f "$PROVISION_CONFIG"/cli-openvpn ]; then
mkdir -p ~/.openvpn
cat >~/.openvpn/_start_cli_template.sh <<"EOF"
#!/usr/bin/env bash
set -euo pipefail
sudo openvpn \
--config $HOME/.openvpn/LOCATION.ovpn \
--script-security 2 \
--auth-user-pass $HOME/.openvpn/creds.txt \
--up /etc/openvpn/update-systemd-resolved \
--down /etc/openvpn/update-systemd-resolved \
--dhcp-option 'DOMAIN-ROUTE .' \
--down-pre
EOF
fi
# The `doctl completion zsh` and the ohmyzsh plugin didn't work during tests
cat >>~/.shell_aliases <<"EOF"
if type doctl >/dev/null 2>&1; then
# Keep the token encrypted and don't keep the user logged in
alias DOLogin='doctl auth init'
alias DOLogout='doctl auth remove --context default'
alias DODroplets='doctl compute droplet list'
fi
EOF
# Potential installs:
# - https://github.com/firebase/firebase-tools
# - https://support.crowdin.com/cli-tool/
provision_setup_cli_tools_aws
provision_setup_cli_tools_hasura
provision_setup_cli_tools_mysql
provision_setup_cli_tools_postgres
}