Working container script & new colorschemes
This commit is contained in:
parent
376174ecc2
commit
1a3264bf03
4 changed files with 984 additions and 11 deletions
|
|
@ -1,6 +1,7 @@
|
|||
#!/bin/bash
|
||||
# Debian containers only
|
||||
PACKAGES="vim git dbus "
|
||||
# ca-certificates needed in order to clone from github
|
||||
PACKAGES="ca-certificates vim git dbus "
|
||||
REPO=https://github.com/SonnyBA/dotfiles.git
|
||||
|
||||
run() {
|
||||
|
|
@ -11,11 +12,7 @@ add_ssh() {
|
|||
sed -i 's/^#Port .*/Port '"$PORT"'/' $CONTAINER_PATH/etc/ssh/sshd_config
|
||||
sed -i 's/^#PermitRootLogin .*/PermitRootLogin yes/' $CONTAINER_PATH/etc/ssh/sshd_config
|
||||
|
||||
# Restart ssh in order to load changes
|
||||
run systemctl restart ssh
|
||||
|
||||
touch $CONTAINER_PATH/root/.bash_profile
|
||||
cat $CONTAINER_PATH/root/.bash_profile <<EOF
|
||||
cat <<- 'EOF' > $CONTAINER_PATH/root/.bash_profile
|
||||
# Start ssh-agent and add keys in ~/.ssh directory
|
||||
# Should only be used without a desktop manager
|
||||
ENV=/tmp/.agent_env
|
||||
|
|
@ -36,8 +33,8 @@ EOF
|
|||
}
|
||||
|
||||
dotfiles() {
|
||||
run git clone $REPO $CONTAINER_PATH/root/dotfiles
|
||||
run $CONTAINER_PATH/root/dotfiles/initialize_script
|
||||
run git clone $REPO /root/dotfiles
|
||||
run /root/dotfiles/initialize_script
|
||||
}
|
||||
|
||||
read -e -p "Enter the path of the container (including container root): " CONTAINER_PATH
|
||||
|
|
@ -69,12 +66,12 @@ mkdir $CONTAINER_PATH/root/.ssh
|
|||
cp $KEY $KEY.pub $CONTAINER_PATH/root/.ssh/
|
||||
|
||||
if [ "$SSH_SERVER" == "y" ] ;then
|
||||
add_ssh $CONTAINER_PATH $PORT
|
||||
add_ssh
|
||||
fi
|
||||
|
||||
if [ "$DOTFILES" == "y" ] ;then
|
||||
dotfiles $CONTAINER_PATH
|
||||
dotfiles
|
||||
fi
|
||||
|
||||
echo "Starting container first time, enter root pass"
|
||||
echo "Enter root pass"
|
||||
run passwd
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue