clc-debian/firstboot.sh

68 lines
2.3 KiB
Bash

#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
doasuser () {
su clc -c "$1"
}
echo "Cleaning up default Gnome Install."
#clean up gnome things
apt purge -y gnome-games xterm gnome-documents gnome-todo gnome-music gnome-maps rhythmbox totem
apt autoremove -y
echo "Installing base applications."
#install google chrome
wget -O chrome.deb https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
apt install -y ./google-chrome-stable_current_amd64.deb
#install zoom
wget -O zoom.deb https://zoom.us/client/latest/zoom_amd64.deb
apt install -y ./zoom.deb
echo "Installing extensions."
wget https://raw.githubusercontent.com/brunelli/gnome-shell-extension-installer/master/gnome-shell-extension-installer
chmod +x gnome-shell-extension-installer
doasuser './gnome-shell-extension-installer 307' #dash-to-dock
echo "Configuring desktop."
#set shell theme and dock
doasuser 'gsettings set org.gnome.desktop.interface gtk-theme "Adwaita-dark"'
doasuser 'gsettings --schemadir ~/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/schemas/ set org.gnome.shell.extensions.dash-to-dock dock-position BOTTOM'
doasuser 'gsettings --schemadir ~/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/schemas/ set org.gnome.shell.extensions.dash-to-dock preferred-monitor 0'
#configure favorites
doasuser 'gsettings set org.gnome.shell favorite-apps '"'"'["firefox-esr.desktop", "google-chrome.desktop", "org.gnome.Nautilus.desktop", "vlc.desktop", "Zoom.desktop", "libreoffice-impress.desktop"]'"'"''
#add min and max buttons to title bars
doasuser 'gsettings set org.gnome.desktop.wm.preferences button-layout "appbar:minimize,maximize,close"'
echo "Cleaning up."
rm chrome.deb zoom.deb gnome-shell-extension-installer
echo "Running update."
apt update
apt upgrade -y
echo "Adding user for ansible"
#add user for ansible remote updates
apt install openssh-server
/usr/sbin/adduser --gecos "" --disabled-login ansible
echo -e "ansible\nansible" | passwd ansible #changed later after first ansible login
/usr/sbin/usermod -a -G sudo ansible
#update hostnames
OLDHOSTNAME=$(cat /etc/hostname)
echo -n "Enter new hostname for system: "
read NEWHOSTNAME
echo $NEWHOSTNAME > /etc/hostname
sed -i "s/$OLDHOSTNAME/$NEWHOSTNAME/g" /etc/hosts
echo "Rebooting..."
systemctl reboot