Update 2023-11-01 11:05 OpenBSD/amd64-x13

This commit is contained in:
c0dev0id 2023-11-01 11:05:52 +01:00
parent ccea430175
commit f0adc85c13

110
init.sh
View File

@ -1,110 +0,0 @@
#!/bin/sh
#
mkdir -p /tmp/init
# INSTALL SSH
if [ ! -d ~/.ssh ]
then
scp -r home.codevoid.de:.ssh ~/
fi
# INSTALL DOAS
if [ ! -f /etc/doas.conf ]
then
scp home.codevoid.de:/etc/doas.conf /tmp/init/
echo "Now enter root password and perform:"
echo "cp /tmp/init/doas.conf /etc/doas.conf; exit;"
/usr/bin/su
fi
# INSTALL SHELL
scp home.codevoid.de:.profile ~/
scp home.codevoid.de:.kshrc ~/
mkdir -p ~/.dev ~/.cache/mutt
touch ~/.dev/dir
doas cp ~/.vimrc /root/.vimrc
doas cp ~/.kshrc /root/.kshrc
doas cp ~/.profile /root/.profile
doas mkdir -p /tank/{buffer,pub,priv,scanner}
# INSTALL CORE PACKAGES
doas pkg_add rsync-- vim--no_x11 git-- notion-- spectrwm-- hsetroot-- autocutsel-- dunst-- xclip-- \
wget-- lftp-- autorandr-- xautolock-- gnupg-- curl-- w3m-- universal-ctags-- \
mutt--gpgme password-store bwm-ng-- sysclean-- fzf-- ugrep-- mpg123-- pkglocatedb-- \
pinentry-dmenu-- nnn--nerd ccache--
doas mkdir -p /opt/ccache/bin
doas ln -s /usr/local/bin/ccache /opt/ccache/bin/cc
doas ln -s /usr/local/bin/ccache /opt/ccache/bin/c++
doas ln -s /usr/local/bin/ccache /opt/ccache/bin/cpp
doas ln -s /usr/local/bin/ccache /opt/ccache/bin/gcc
doas ln -s /usr/local/bin/ccache /opt/ccache/bin/g++
doas ln -s /usr/local/bin/ccache /opt/ccache/bin/clang
doas mkdir /var/ccache
doas chown -R build /var/ccache
# INIT DOTFILES
if [ ! -d ~/.cfg ]
then
git --no-replace-objects clone --bare --depth 1 _gitea@git.uugrn.org:sdk/dotfiles.git $HOME/.cfg
git --git-dir=${HOME}/.cfg/ --work-tree=${HOME} config --local status.showUntrackedFiles no
git --git-dir=${HOME}/.cfg/ --work-tree=${HOME} checkout -f
fi
if [ ! -f /etc/mk.conf ]
then
doas cp -r ~/.etc/* /etc/
if [ ! -f /etc/fstab.bak ]
then
doas cp /etc/fstab /etc/fstab.bak
fi
doas sed -i 's/nodev/softdep,nodev/g' /etc/fstab
doas cat /etc/fstab /etc/fstab.local > /tmp/fstab
doas cp /tmp/fstab /etc/fstab
fi
# INIT X stuff
if [ ! -f ~/.xsession ]
then
scp home.codevoid.de:.xsession ~/
fi
if [ ! -d ~/.fonts ]
then
scp -r home.codevoid.de:.fonts ~/
fi
if [ ! -d ~/code ]
then
mkdir ~/code
scp -r home.codevoid.de:code/st ~/code/
scp -r home.codevoid.de:code/cbar ~/code/
cd ~/code/st && make && doas make install
cd ~/code/cbar && make && doas make install
fi
# INSTALL BIG PACKAGES
doas pkg_add chromium mpv firefox libreoffice pdfarranger ocrmypdf \
tesseract-deu mupdf--js msmtp-- dbus--
echo -n "Is this a secure machine [y/N]?: "
read
case $REPLY in
[yY]) SECURE_ENV=Y; ;;
esac
if [ "$SECURE_ENV" == "Y" ]
then
if [ ! -d ~/.password-store ]
then
git clone sdk@home.codevoid.de:.password-store.git
fi
if [ ! -d ~/.gnupg ]
then
scp -r home.codevoid.de:.gnupg ~/
sed -i 's/-curses/-dmenu/g' ~/.gnupg/gpg-agent.conf
fi
fi