summaryrefslogtreecommitdiffstats
path: root/provision_openbsd.ksh
blob: a0047ff9d348cd7276483998926380527bf75251 (plain) (blame)
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/bin/ksh

# Send in id_rsa.pub and id_rsa
# send in /etc/doas.conf and install and chown root:wheel /etc/doas.conf
# pkg_add git in guest
# send in openbsddotfiles/profile_vm_provisioning (or similar) and rename to .profile
# source .profile in guest
# send in THIS FILE AND EXECUTE IT ON THERE

# download ISO from https://cdn.openbsd.org/pub/OpenBSD/$(uname -r)/amd64/install71.iso

ssh-add -v

while getopts c provopts
do
  case $provopts in
    c) flag=1, print "Got flag" ;;
    ?) print "Bonkers"; exit ;;
  esac
done


pkg_add vim the_silver_searcher zip 

echo -n "Creating necessary directories..."
mkdir -p ~/code/python
mkdir -p ~/.config/
echo "ok"

echo -n "Fetching dotfiles..."
if [ ! -d ~/openbsddotfiles ]; then
  git clone git@github.com:yulqen/openbsddotfiles.git ~/openbsddotfiles 2>&1 > /dev/null
  echo "ok"
else
  echo "dotfiles directory already exists."
fi

echo -n "Fetching dbasik..."
if [ ! -d ~/code/python/dbasik ]; then
  git clone git@github.com:yulqen/dbasik.git ~/code/python/dbasik  2>&1 > /dev/null
  echo "ok"
else
  echo "dbasik directory already exists."
fi

echo -n "Fetching datamaps..."
if [ ! -d ~/code/python/datamaps ]; then
  git clone git@github.com:yulqen/datamaps.git ~/code/python/datamaps 2>&1 > /dev/null
  echo "ok"
else
  echo "datamaps directory already exists."
fi

echo -n "Fetching bcompiler-engine..."
if [ ! -d ~/code/python/bcompiler-engine ]; then
  git clone git@github.com:yulqen/bcompiler-engine.git ~/code/python/bcompiler-engine 2>&1 > /dev/null
  echo "ok"
else
  echo "bcompiler-engine directory already exists."
fi

echo -n "Creating symlinks..."
ln -sf openbsddotfiles/kshrc_vm_provision .kshrc
ln -sf openbsddotfiles/ksh_aliases .ksh_aliases
ln -sf openbsddotfiles/profile_vm_provisioning .profile
ln -sf openbsddotfiles/tmux.conf .tmux.conf
ln -sf openbsddotfiles/vim .vim
ln -sf openbsddotfiles/gitconfig .gitconfig
ln -sf openbsddotfiles/gitignore_global .gitignore_global
ln -sf openbsddotfiles/pdbrc .pdbrc
ln -sf openbsddotfiles/pdbrc.py .pdbrc.py
ln -sf openbsddotfiles/flake8 /home/lemon/.config/.flake8
echo "ok"