-
Notifications
You must be signed in to change notification settings - Fork 5
/
init.sh
executable file
·24 lines (18 loc) · 1.07 KB
/
init.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash
# exit if a command fails
set -e
# install initial packages
sudo dnf install -y vim ansible git zsh python3-libselinux python3-dnf
# clone dotfiles, if this doesn't work just clone it in ~/Workstation/dotfiles manually
mkdir -p ~/Workstation
read -r -p "Enter your Github Token (https://github.com/settings/tokens/new): " TOKEN
test -d ~/Workstation/dotfiles \
|| git clone --recursive "https://${USER}:${TOKEN}@github.com/${USER}/dotfiles.git" ~/Workstation/dotfiles
test -d ~/Workstation/my-fedora-workstation \
|| git clone "https://${USER}:${TOKEN}@github.com/${USER}/my-fedora-workstation.git" ~/Workstation/my-fedora-workstation
cd ~/Workstation/my-fedora-workstation \
&& ansible-playbook -i ./hosts.dist -K ./main.yml
# Let's put the repos remote back to git scp style, https will keep
# asking for Auth but now everything should just work!
(cd ~/Workstation/my-fedora-workstation && git remote set-url origin [email protected]:${USER}/my-fedora-workstation.git)
(cd ~/Workstation/dotfiles && git remote set-url origin [email protected]:${USER}/dotfiles.git)