-
Notifications
You must be signed in to change notification settings - Fork 2
/
entrypoint.sh
executable file
·46 lines (34 loc) · 944 Bytes
/
entrypoint.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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/env bash
if [[ -f "${HOME}/.lock" ]]; then
echo "Finish the setup before"
exit
fi
touch "${HOME}/.lock"
install_dotfiles() {
git clone -q https://github.com/samirettali/dotfiles
rm $HOME/.zshrc
rm $HOME/.bashrc
bash ./dotfiles/install.sh
}
cd ${HOME}
if [[ ! -f "${HOME}/.first-run" ]]; then
echo "Looks like you are running this container for the first time."
read -p "Do you want to download wordlists? (y/any) " answer
case $answer in
[Yy]* ) ./download-wordlists.sh ;;
esac
read -p "Do you want to install dotfiles? (y/any) " answer
case $answer in
[Yy]*) install_dotfiles ;;
esac
# Exporting SHELL is needed as chsh does not update it immediately
read -p "Do you want to set zsh as default? (y/any) " answer
case $answer in
[Yy]* ) chsh -s /bin/zsh;;
esac
touch "${HOME}/.first-run"
echo "Have fun :)"
fi
rm "${HOME}/.lock"
shell=$(grep root /etc/passwd | sed 's/^.*://g')
exec ${shell}