Updated for kali, ready for testing
This commit is contained in:
1 parent
83ee5a3678
commit
5ec6951eda
14 files changed
+105
-50
No files matched your search
+64
-18
@@ -1,35 +1,81 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Todo:
|
||||
# - Add error handling for each step
|
||||
read -p "Gibson Share Password: " GIBSON_PASS
|
||||
|
||||
HDOS_ROOT=/opt/hdos
|
||||
rm -rf ${HDOS_ROOT}
|
||||
|
||||
if [ -d ${HDOS_ROOT} ]; then
|
||||
rm -rf ${HDOS_ROOT}
|
||||
fi
|
||||
|
||||
if [ "$(id -u)" -ne 0 ]; then
|
||||
echo "This script must be run as root"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
chmod +x ${HDOS_ROOT}/scripts/*
|
||||
apt install git sudo curl wget zsh -yqq
|
||||
|
||||
git clone https://git.corrupt.link/liz/hdos.git ${HDOS_ROOT}
|
||||
chmod -R 755 ${HDOS_ROOT}
|
||||
|
||||
cp ${HDOS_ROOT}/lists/sources.list /etc/apt/sources.list
|
||||
|
||||
apt update
|
||||
|
||||
apt upgrade -yqq
|
||||
apt full-upgrade -yqq
|
||||
|
||||
xargs apt install -y < ${HDOS_ROOT}/lists/apt-packages
|
||||
INSTALLED=`dpkg --get-selections | grep -e " install$" | sed -e 's/\t\+install//'`
|
||||
while read PACKAGE; do
|
||||
if ! echo "$INSTALLED" | grep -q "^$PACKAGE$"; then
|
||||
apt install -yqq "$PACKAGE"
|
||||
fi
|
||||
done < ${HDOS_ROOT}/lists/apt-packages
|
||||
|
||||
apt autoremove -y
|
||||
|
||||
${HDOS_ROOT}/scripts/nvm
|
||||
${HDOS_ROOT}/scripts/codium
|
||||
${HDOS_ROOT}/scripts/ohmyzsh
|
||||
cat ${HDOS_ROOT}/dotfiles/rc_addition >> /home/hacdc/.zshrc
|
||||
groupadd --gid 1900 classroom
|
||||
usermod -aG classroom hacdc
|
||||
useradd -m -s /usr/bin/zsh -G dialout,cdrom,floppy,audio,video,wireshark,classroom guest
|
||||
cp /home/hacdc/.zshrc /home/guest/.zshrc
|
||||
chown guest:guest /home/guest/.zshrc
|
||||
|
||||
chsh root /usr/bin/zsh
|
||||
chsh hacdc /usr/bin/zsh
|
||||
|
||||
sudo -u hacdc ${HDOS_ROOT}/scripts/ohmyzsh
|
||||
sudo -u hacdc ${HDOS_ROOT}/scripts/nvm
|
||||
sudo -u hacdc ${HDOS_ROOT}/scripts/pyenv
|
||||
sudo -u hacdc gpg --list-keys
|
||||
cp ${HDOS_ROOT}/dotfiles/zshrc /root/.zshrc
|
||||
cp ${HDOS_ROOT}/dotfiles/zshrc /home/hacdc/.zshrc
|
||||
chown hacdc:hacdc /home/hacdc/.zshrc
|
||||
|
||||
cp ${HDOS_ROOT}/dotfiles/slick-greeter.conf /etc/lightdm/
|
||||
cp ${HDOS_ROOT}/dotfiles/htown.png /etc/lightdm/
|
||||
sudo -u guest ${HDOS_ROOT}/scripts/nvm
|
||||
sudo -u guest ${HDOS_ROOT}/scripts/pyenv
|
||||
|
||||
# Generate GPG framework
|
||||
sudo -u hacdc gpg --list-keys
|
||||
sudo -u guest gpg --list-keys
|
||||
|
||||
# Setup Shared Directory
|
||||
SHARED_DIR=/mnt/gibson
|
||||
if [ ! -d ${SHARED_DIR} ]; then
|
||||
mkdir -p ${SHARED_DIR}
|
||||
cat ${HDOS_ROOT}/dotfiles/gibson > /etc/gibson
|
||||
chmod 600 /etc/gibson
|
||||
cat ${HDOS_ROOT}/dotfiles/fstab >> /etc/fstab
|
||||
chmod 766 ${SHARED_DIR}
|
||||
sed -i "s/password=/password=${GIBSON_PASS}/" /etc/gibson
|
||||
systemctl daemon-reload
|
||||
ln -s ${SHARED_DIR} /home/hacdc/Desktop/gibson
|
||||
ln -s ${SHARED_DIR} /home/guest/Desktop/gibson
|
||||
chown guest:guest /home/guest/Desktop/gibson
|
||||
chown hacdc:hacdc /home/hacdc/Desktop/gibson
|
||||
chmod 755 ${SHARED_DIR}
|
||||
fi
|
||||
|
||||
# Set login wallpaper
|
||||
cp ${HDOS_ROOT}/dotfiles/htown.png /usr/share/backgrounds/htown.png
|
||||
sed -i 's/^background=.*$/background=\/usr\/share\/backgrounds\/htown.png/' /usr/share/sddm/themes/*/theme.conf.user
|
||||
|
||||
mksquashfs /home/guest ${HDOS_ROOT}/guest.sqfs --noappend
|
||||
cp ${HDOS_ROOT}/scripts/restore-home /usr/sbin/restore-home
|
||||
cp ${HDOS_ROOT}/dotfiles/guest-restore.service /etc/systemd/system/guest-restore.service
|
||||
systemctl daemon-reload
|
||||
systemctl enable guest-restore.service
|
||||
|
||||
|
||||
Reference in new issue
Block a user