2018-02-26 02:41:29 +01:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
|
|
|
set -ex
|
|
|
|
|
|
|
|
if [[ $EUID -ne 0 ]]; then
|
|
|
|
echo "This script must be run as root" 1>&2
|
|
|
|
sudo $0
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
echo "Als root Angemeldet"
|
|
|
|
#
|
|
|
|
|
|
|
|
VERSION_ID=$(cat /etc/os-release | grep "ID")
|
|
|
|
RCLOCAL='/etc/rc.local'
|
|
|
|
SYSCTL='/etc/sysctl.conf'
|
2018-02-26 02:46:23 +01:00
|
|
|
WEBADDRESS="https://github.com/simono41/SpectreOS.git"
|
|
|
|
WEBADDRESS1="https://github.com/simono41/shell-scripte.git"
|
2018-02-26 02:41:29 +01:00
|
|
|
SUDOERS="/etc/sudoers"
|
|
|
|
repo="SpectreOS"
|
|
|
|
repo1="shell-scripte"
|
|
|
|
version="$1"
|
|
|
|
username="$2"
|
|
|
|
userpass="$3"
|
|
|
|
|
|
|
|
[[ -z "${version}" ]] && version="voll"
|
|
|
|
[[ -z "${username}" ]] && username="user1"
|
|
|
|
[[ -z "${userpass}" ]] && userpass="user1"
|
|
|
|
|
|
|
|
function gitclone() {
|
2018-03-10 22:17:49 +01:00
|
|
|
if [ -d "/opt/${repo}" ]; then
|
2018-02-26 02:41:29 +01:00
|
|
|
echo "${repo} existiert bereits!!!"
|
2018-03-10 22:13:56 +01:00
|
|
|
cd /opt/${repo}
|
|
|
|
git pull
|
|
|
|
else
|
2018-03-10 22:17:49 +01:00
|
|
|
git clone ${WEBADDRESS} /opt/${repo}
|
2018-02-26 02:41:29 +01:00
|
|
|
fi
|
2018-03-10 22:17:49 +01:00
|
|
|
if [ -d "/opt/${repo1}" ]; then
|
2018-02-26 02:41:29 +01:00
|
|
|
echo "${repo1} existiert bereits!!!"
|
2018-03-10 22:13:56 +01:00
|
|
|
cd /opt/${repo1}
|
|
|
|
git pull
|
|
|
|
else
|
2018-03-10 22:17:49 +01:00
|
|
|
git clone ${WEBADDRESS1} /opt/${repo1}
|
2018-02-26 02:41:29 +01:00
|
|
|
fi
|
|
|
|
cd /
|
|
|
|
}
|
|
|
|
|
|
|
|
function yaourtinstall() {
|
|
|
|
su "$username" -c "yaourt -S $1 --needed --noconfirm"
|
|
|
|
}
|
|
|
|
|
|
|
|
function standartinstallation() {
|
2018-02-27 23:03:01 +01:00
|
|
|
pacman -Syu $(cat /opt/${repo}/packages_${version}.txt) --needed --noconfirm
|
2018-02-26 02:41:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
function ldconfigcache() {
|
|
|
|
rm /etc/ld.so.cache
|
|
|
|
ldconfig
|
|
|
|
}
|
|
|
|
|
|
|
|
function check() {
|
|
|
|
if [ -f /usr/lib/systemd/system/x11vnc.service ]; then
|
|
|
|
rm /usr/lib/systemd/system/x11vnc.service
|
|
|
|
fi
|
|
|
|
if [ -f /etc/systemd/system/x11vnc.service ]; then
|
|
|
|
rm /etc/systemd/system/x11vnc.service
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
function checkend() {
|
2018-02-27 23:03:01 +01:00
|
|
|
cp /opt/${repo}/x11vnc.service /etc/systemd/system/x11vnc.service
|
2018-02-26 02:41:29 +01:00
|
|
|
chmod 644 /etc/systemd/system/x11vnc.service
|
|
|
|
systemctl enable x11vnc.service
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
function adduser() {
|
|
|
|
useradd -m -g users -G wheel,audio,video,sys,optical -s /bin/bash $username
|
|
|
|
passwd ${username} <<EOT
|
|
|
|
${userpass}
|
|
|
|
${userpass}
|
|
|
|
EOT
|
|
|
|
mkdir -p /home/"$username"/
|
|
|
|
userrechte
|
|
|
|
}
|
|
|
|
|
|
|
|
function copyconfig() {
|
|
|
|
cp -aRv /root/. /home/"$username"/
|
|
|
|
#links
|
|
|
|
links
|
|
|
|
userrechte
|
|
|
|
}
|
|
|
|
|
|
|
|
function userrechte() {
|
|
|
|
#user
|
|
|
|
chown -cR -v "$username":users /home/"$username"
|
|
|
|
chmod 750 -Rv /home/"$username"
|
|
|
|
#ssh
|
|
|
|
chmod 755 /home/"$username"/
|
|
|
|
if [ -d /home/"$username"/.ssh ]; then
|
|
|
|
chmod 700 /home/"$username"/.ssh
|
|
|
|
fi
|
|
|
|
if [ -f /home/"$username"/.ssh/id_rsa ]; then
|
|
|
|
chmod 600 /home/"$username"/.ssh/id_rsa
|
|
|
|
fi
|
|
|
|
if [ -f /home/"$username"/.ssh/authorized_keys ]; then
|
|
|
|
chmod 600 /home/"$username"/.ssh/authorized_keys
|
|
|
|
fi
|
|
|
|
|
|
|
|
#root
|
|
|
|
chmod 750 -Rv /root
|
|
|
|
#ssh-root
|
|
|
|
chmod 755 /root/
|
|
|
|
if [ -d /root/.ssh ]; then
|
|
|
|
chmod 700 /root/.ssh
|
|
|
|
fi
|
|
|
|
if [ -f /root/.ssh/id_rsa ]; then
|
|
|
|
chmod 600 /root/.ssh/id_rsa
|
|
|
|
fi
|
|
|
|
if [ -f /root/.ssh/authorized_key ]; then
|
|
|
|
chmod 600 /root/.ssh/authorized_keys
|
|
|
|
fi
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
function links() {
|
|
|
|
#
|
|
|
|
mkdir -p /home/"$username"/Schreibtisch/
|
|
|
|
if [ -f "/usr/share/applications/arch-install.desktop" ]; then
|
|
|
|
if [ -f "/home/"$username"/Schreibtisch/arch-install.desktop" ]; then
|
|
|
|
echo "datei existiert bereits!"
|
|
|
|
else
|
|
|
|
ln -s /usr/share/applications/arch-install.desktop /home/"$username"/Schreibtisch/arch-install.desktop
|
|
|
|
fi
|
|
|
|
#chmod +x /home/"$username"/Schreibtisch/arch-install.desktop
|
|
|
|
fi
|
|
|
|
#
|
|
|
|
mkdir -p /root/Schreibtisch/
|
|
|
|
if [ -f "/usr/share/applications/arch-install.desktop" ]; then
|
|
|
|
if [ -f "/root/Schreibtisch/arch-install.desktop" ]; then
|
|
|
|
echo "datei existiert bereits!"
|
|
|
|
else
|
|
|
|
ln -s /usr/share/applications/arch-install.desktop /root/Schreibtisch/arch-install.desktop
|
|
|
|
fi
|
|
|
|
#chmod +x /root/Schreibtisch/arch-install.desktop
|
|
|
|
fi
|
|
|
|
#
|
|
|
|
mkdir -p /home/"$username"/Desktop/
|
|
|
|
if [ -f "/usr/share/applications/arch-install.desktop" ]; then
|
|
|
|
if [ -f "/home/"$username"/Desktop/arch-install.desktop" ]; then
|
|
|
|
echo "datei existiert bereits!"
|
|
|
|
else
|
|
|
|
ln -s /usr/share/applications/arch-install.desktop /home/"$username"/Desktop/arch-install.desktop
|
|
|
|
fi
|
|
|
|
#chmod +x /home/"$username"/Desktop/arch-install.desktop
|
|
|
|
fi
|
|
|
|
#
|
|
|
|
mkdir -p /root/Desktop/
|
|
|
|
if [ -f "/usr/share/applications/arch-install.desktop" ]; then
|
|
|
|
if [ -f "/root/Desktop/arch-install.desktop" ]; then
|
|
|
|
echo "datei existiert bereits!"
|
|
|
|
else
|
|
|
|
ln -s /usr/share/applications/arch-install.desktop /root/Desktop/arch-install.desktop
|
|
|
|
fi
|
|
|
|
#chmod +x /root/Desktop/arch-install.desktop
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
function gnomeconfig() {
|
|
|
|
mkdir -p /home/"$username"/.config/gtk-3.0/
|
|
|
|
echo "[Settings]" > /home/"$username"/.config/gtk-3.0/settings.ini
|
|
|
|
echo "gtk-theme-name = Adwaita" >> /home/"$username"/.config/gtk-3.0/settings.ini
|
|
|
|
echo "# next option is applicable only if selected theme supports it" >> /home/"$username"/.config/gtk-3.0/settings.ini
|
|
|
|
echo "gtk-application-prefer-dark-theme = true" >> /home/"$username"/.config/gtk-3.0/settings.ini
|
|
|
|
echo "# set font name and dimension" >> /home/"$username"/.config/gtk-3.0/settings.ini
|
|
|
|
echo "gtk-font-name = Sans 10" >> /home/"$username"/.config/gtk-3.0/settings.ini
|
|
|
|
|
|
|
|
mkdir -p /home/"$username"/.local/share/applications/
|
|
|
|
echo "[Default Applications]" > /home/"$username"/.local/share/applications/mimeapps.list
|
|
|
|
echo "inode/directory=org.gnome.Nautilus.desktop" >> /home/"$username"/.local/share/applications/mimeapps.list
|
|
|
|
|
|
|
|
mkdir -p /root/.config/gtk-3.0/
|
|
|
|
echo "[Settings]" > /root/.config/gtk-3.0/settings.ini
|
|
|
|
echo "gtk-theme-name = Adwaita" >> /root/.config/gtk-3.0/settings.ini
|
|
|
|
echo "# next option is applicable only if selected theme supports it" >> /root/.config/gtk-3.0/settings.ini
|
|
|
|
echo "gtk-application-prefer-dark-theme = true" >> /root/.config/gtk-3.0/settings.ini
|
|
|
|
echo "# set font name and dimension" >> /root/.config/gtk-3.0/settings.ini
|
|
|
|
echo "gtk-font-name = Sans 10" >> /root/.config/gtk-3.0/settings.ini
|
|
|
|
|
|
|
|
mkdir -p /root/.local/share/applications/
|
|
|
|
echo "[Default Applications]" > /root/.local/share/applications/mimeapps.list
|
|
|
|
echo "inode/directory=org.gnome.Nautilus.desktop" >> /root/.local/share/applications/mimeapps.list
|
|
|
|
|
|
|
|
gsettings set org.gnome.desktop.media-handling automount 'false'
|
|
|
|
gsettings set org.gnome.desktop.media-handling automount-open 'false'
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
|
|
|
if [ "$1" == "adduser" ]
|
|
|
|
then
|
|
|
|
username=$2
|
|
|
|
userpass=$3
|
|
|
|
adduser
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
if cat /etc/passwd | grep ${username} > /dev/null; then
|
|
|
|
echo "${username} existiert bereits!!!"
|
|
|
|
else
|
|
|
|
adduser
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$erstellen" == "exit" ]
|
|
|
|
then
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
# sudoers/wheel
|
|
|
|
|
|
|
|
echo "Lege $SUDOERS neu an!!!"
|
|
|
|
|
|
|
|
echo "root ALL=(ALL) NOPASSWD: ALL" > $SUDOERS
|
|
|
|
|
|
|
|
echo "%wheel ALL=(ALL) NOPASSWD: ALL" >> $SUDOERS
|
|
|
|
|
|
|
|
gitclone
|
|
|
|
|
|
|
|
# Your commands
|
|
|
|
|
|
|
|
# modprobe.d
|
|
|
|
mkdir -p /etc/modprobe.d/
|
|
|
|
echo "blacklist floppy" > /etc/modprobe.d/blacklist-floppy.conf
|
|
|
|
|
|
|
|
# startup
|
2018-02-27 22:53:24 +01:00
|
|
|
cp /opt/${repo}/startup /usr/bin/
|
2018-02-26 02:41:29 +01:00
|
|
|
chmod 755 /usr/bin/startup
|
2018-02-27 22:53:24 +01:00
|
|
|
cp /opt/${repo}/startup.service /etc/systemd/system/
|
2018-02-26 02:41:29 +01:00
|
|
|
chmod 644 /etc/systemd/system/startup.service
|
|
|
|
systemctl enable startup.service
|
|
|
|
|
|
|
|
# pacman-config
|
|
|
|
if [ "${version}" == "libre" ]; then
|
2018-02-27 22:53:24 +01:00
|
|
|
cp /opt/${repo}/pacman.conf_libre /etc/pacman.conf
|
2018-02-26 02:41:29 +01:00
|
|
|
else
|
2018-02-27 22:53:24 +01:00
|
|
|
cp /opt/${repo}/pacman.conf /etc/pacman.conf
|
2018-02-26 02:41:29 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
# new-config
|
|
|
|
if [ -d /home/"$username"/.config ]; then
|
|
|
|
rm -Rv /home/"$username"/.config
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -d /root/.config ]; then
|
|
|
|
rm -Rv /root/.config
|
|
|
|
fi
|
|
|
|
|
|
|
|
# mirrorlist
|
2018-02-27 22:53:24 +01:00
|
|
|
cp /opt/${repo}/mirrorlist_libre /etc/pacman.d/mirrorlist_libre
|
|
|
|
cp /opt/${repo}/mirrorlist /etc/pacman.d/mirrorlist
|
2018-02-26 02:41:29 +01:00
|
|
|
|
|
|
|
if [ -f /var/lib/pacman/db.lck ];then
|
|
|
|
rm /var/lib/pacman/db.lck
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$vollinstallation" != "n" ]
|
|
|
|
then
|
|
|
|
check
|
|
|
|
if [ "$vollinstallation" != "debug" ]; then
|
|
|
|
standartinstallation
|
|
|
|
fi
|
|
|
|
checkend
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "${version}" != "libre" ]; then
|
|
|
|
if [ "$yaourt" != "n" ]
|
|
|
|
then
|
|
|
|
if [ "$yaourt" != "debug" ]; then
|
|
|
|
cd /home/"$username"/
|
|
|
|
pwd
|
|
|
|
su "$username" -c "curl -O https://aur.archlinux.org/cgit/aur.git/snapshot/package-query.tar.gz"
|
|
|
|
pwd
|
|
|
|
su "$username" -c "tar -xvzf package-query.tar.gz"
|
|
|
|
pwd
|
|
|
|
cd package-query
|
|
|
|
pwd
|
|
|
|
su "$username" -c "makepkg -si" <<EOT
|
|
|
|
|
|
|
|
|
|
|
|
EOT
|
|
|
|
pwd
|
|
|
|
cd ..
|
|
|
|
pwd
|
|
|
|
su "$username" -c "curl -O https://aur.archlinux.org/cgit/aur.git/snapshot/yaourt.tar.gz"
|
|
|
|
pwd
|
|
|
|
su "$username" -c "tar -xvzf yaourt.tar.gz"
|
|
|
|
pwd
|
|
|
|
cd yaourt
|
|
|
|
pwd
|
|
|
|
su "$username" -c "makepkg -si" <<EOT
|
|
|
|
|
|
|
|
|
|
|
|
EOT
|
|
|
|
pwd
|
|
|
|
cd ..
|
|
|
|
pwd
|
|
|
|
su "$username" -c "mkdir -p /home/"$username"/aur-pakete"
|
|
|
|
pwd
|
|
|
|
fi
|
|
|
|
yaourtinstall pamac-aur
|
2018-02-26 04:39:36 +01:00
|
|
|
|
2018-02-26 02:41:29 +01:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
echo "Packetliste2 Ende"
|
|
|
|
echo "Beginne mit dem Konfigurieren des Systems :D"
|
|
|
|
# set desktop
|
|
|
|
echo "set desktop"
|
|
|
|
#
|
2018-02-27 22:53:24 +01:00
|
|
|
cp /opt/${repo}/xinitrc_${version}.txt /etc/X11/xinit/xinitrc
|
2018-02-26 02:41:29 +01:00
|
|
|
#
|
|
|
|
echo "Systemsprache und dienste werden erstellt!"
|
|
|
|
|
|
|
|
mkdir -p /etc/X11/xorg.conf.d/
|
|
|
|
# localectl set-x11-keymap de pc105 nodeadkeys
|
|
|
|
echo "Section \"InputClass\"" > /etc/X11/xorg.conf.d/20-keyboard.conf
|
|
|
|
echo " Identifier \"Keyboard0\"" >> /etc/X11/xorg.conf.d/20-keyboard.conf
|
|
|
|
echo " MatchIsKeyboard \"yes\"" >> /etc/X11/xorg.conf.d/20-keyboard.conf
|
|
|
|
echo " Option \"XkbLayout\" \"de\"" >> /etc/X11/xorg.conf.d/20-keyboard.conf
|
|
|
|
echo " Option \"XkbModel\" \"pc105\"" >> /etc/X11/xorg.conf.d/20-keyboard.conf
|
|
|
|
echo " Option \"XkbVariant\" \"nodeadkeys\"" >> /etc/X11/xorg.conf.d/20-keyboard.conf
|
|
|
|
echo "EndSection" >> /etc/X11/xorg.conf.d/20-keyboard.conf
|
|
|
|
|
|
|
|
#xset m 2/1 0
|
|
|
|
echo "Section \"InputClass\"" > /etc/X11/xorg.conf.d/50-mouse-acceleration.conf
|
|
|
|
echo " Identifier \"Mouse0\"" >> /etc/X11/xorg.conf.d/50-mouse-acceleration.conf
|
|
|
|
echo " MatchIsPointer \"yes\"" >> /etc/X11/xorg.conf.d/50-mouse-acceleration.conf
|
|
|
|
echo "# set the following to 1 1 0 respectively to disable acceleration." >> /etc/X11/xorg.conf.d/50-mouse-acceleration.conf
|
|
|
|
echo " Option \"AccelerationNumerator\" \"2\"" >> /etc/X11/xorg.conf.d/50-mouse-acceleration.conf
|
|
|
|
echo " Option \"AccelerationDenominator\" \"1\"" >> /etc/X11/xorg.conf.d/50-mouse-acceleration.conf
|
|
|
|
echo " Option \"AccelerationThreshold\" \"4\"" >> /etc/X11/xorg.conf.d/50-mouse-acceleration.conf
|
|
|
|
echo "EndSection" >> /etc/X11/xorg.conf.d/50-mouse-acceleration.conf
|
|
|
|
|
|
|
|
# set system startup files
|
|
|
|
echo "System startup files"
|
|
|
|
|
|
|
|
start=getty
|
|
|
|
|
|
|
|
if [ "$start" == "getty" ]
|
|
|
|
then
|
|
|
|
|
|
|
|
echo "if [ \$(tty) = "/dev/tty1" ]; then" > /root/.bash_profile
|
|
|
|
echo "startx" >> /root/.bash_profile
|
|
|
|
echo "fi" >> /root/.bash_profile
|
|
|
|
#
|
|
|
|
echo "if [ \$(tty) = "/dev/tty1" ]; then" > /home/"$username"/.bash_profile
|
|
|
|
echo "startx" >> /home/"$username"/.bash_profile
|
|
|
|
echo "fi" >> /home/"$username"/.bash_profile
|
|
|
|
#
|
|
|
|
|
|
|
|
start=${username}
|
|
|
|
if [ "$start" == "root" ]
|
|
|
|
then
|
|
|
|
mkdir -p /etc/systemd/system/getty\@tty1.service.d
|
|
|
|
echo "[Service]" > /etc/systemd/system/getty\@tty1.service.d/autologin.conf
|
|
|
|
echo "ExecStart=" >> /etc/systemd/system/getty\@tty1.service.d/autologin.conf
|
|
|
|
echo "ExecStart=-/sbin/agetty --noclear -a root %I 38400 linux" >> /etc/systemd/system/getty\@tty1.service.d/autologin.conf
|
|
|
|
systemctl enable getty@tty1
|
|
|
|
else
|
|
|
|
mkdir -p /etc/systemd/system/getty\@tty1.service.d
|
|
|
|
echo "[Service]" > /etc/systemd/system/getty\@tty1.service.d/autologin.conf
|
|
|
|
echo "ExecStart=" >> /etc/systemd/system/getty\@tty1.service.d/autologin.conf
|
|
|
|
echo "ExecStart=-/sbin/agetty --noclear -a "$username" %I 38400 linux" >> /etc/systemd/system/getty\@tty1.service.d/autologin.conf
|
|
|
|
systemctl enable getty@tty1
|
|
|
|
fi
|
|
|
|
|
|
|
|
elif [ "$start" == "xdm" ]
|
|
|
|
then
|
|
|
|
systemctl enable xdm
|
|
|
|
elif [ "$start" == "lightdm" ]
|
|
|
|
then
|
|
|
|
systemctl enable lightdm.service
|
|
|
|
elif [ "$start" == "exit" ]
|
|
|
|
then
|
|
|
|
exit 0
|
|
|
|
else
|
|
|
|
echo "Kein Start gewählt!!!"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "${vollinstallation}" != "n" ]; then
|
|
|
|
systemctl enable acpid
|
|
|
|
systemctl enable ntpd
|
|
|
|
systemctl enable avahi-daemon
|
|
|
|
systemctl enable org.cups.cupsd.service
|
|
|
|
systemctl enable sshd
|
|
|
|
systemctl enable cronie
|
|
|
|
systemctl enable systemd-timesyncd.service
|
|
|
|
echo "Bitte OpenVPN config in die /etc/openvpn/client/client.conf kopieren!!!"
|
|
|
|
if [ -f /lib/systemd/system/openvpn-client@client.service ]; then
|
|
|
|
echo "link vorhanden!"
|
|
|
|
else
|
|
|
|
ln /lib/systemd/system/openvpn-client@.service /lib/systemd/system/openvpn-client@client.service
|
|
|
|
fi
|
|
|
|
#Bei ausdokumentierung wird eine/die VPN automatisch aus der /etc/openvpn/client/client.conf gestartet!!!
|
|
|
|
#systemctl enable openvpn-client@client.service
|
|
|
|
systemctl enable fail2ban
|
|
|
|
systemctl disable dhcpcd
|
|
|
|
systemctl enable NetworkManager.service
|
|
|
|
fi
|
|
|
|
|
|
|
|
# set systemconfiguration
|
|
|
|
echo "systemconfiguration"
|
|
|
|
#
|
|
|
|
echo "LANG=de_DE.UTF-8" > /etc/locale.conf
|
|
|
|
echo "LC_COLLATE=C" >> /etc/locale.conf
|
|
|
|
echo "LANGUAGE=de_DE" >> /etc/locale.conf
|
|
|
|
#
|
|
|
|
echo "KEYMAP=de-latin1" > /etc/vconsole.conf
|
|
|
|
echo "FONT=lat9w-16" >> /etc/vconsole.conf
|
|
|
|
#
|
|
|
|
echo "de_DE.UTF-8 UTF-8" > /etc/locale.gen
|
|
|
|
echo "de_DE ISO-8859-1" >> /etc/locale.gen
|
|
|
|
echo "de_DE@euro ISO-8859-15" >> /etc/locale.gen
|
|
|
|
echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen
|
|
|
|
#
|
|
|
|
locale-gen
|
|
|
|
#
|
|
|
|
rm /etc/localtime
|
|
|
|
ln -s /usr/share/zoneinfo/Europe/Berlin /etc/localtime
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# custom-bereich vollinstallation
|
|
|
|
|
|
|
|
if [ "${vollinstallation}" != "n" ]; then
|
|
|
|
|
|
|
|
# custom-installer
|
|
|
|
|
|
|
|
# pip install beautysh
|
|
|
|
if [ -d /opt/beautysh ];then
|
|
|
|
echo "Bereits vorhanden!!!"
|
2018-03-10 22:13:56 +01:00
|
|
|
cd /opt/beautysh
|
|
|
|
git pull
|
2018-02-26 02:41:29 +01:00
|
|
|
else
|
|
|
|
git clone https://github.com/bemeurer/beautysh /opt/beautysh
|
|
|
|
fi
|
|
|
|
cd /opt/beautysh
|
|
|
|
python ./setup.py install
|
|
|
|
if [ -f /usr/bin/beautysh ]; then
|
|
|
|
echo "Bereits vorhanden!!!"
|
|
|
|
else
|
|
|
|
ln -s /opt/beautysh/beautysh/beautysh.py /usr/bin/beautysh
|
|
|
|
fi
|
|
|
|
chmod +x /usr/bin/beautysh
|
|
|
|
cd /
|
|
|
|
|
|
|
|
pip install powerline-shell
|
|
|
|
|
|
|
|
# powerline-shell-fonts
|
|
|
|
if [ -d /opt/powerline-shell-fonts ];then
|
|
|
|
echo "Bereits vorhanden!!!"
|
2018-03-10 22:13:56 +01:00
|
|
|
cd /opt/powerline-shell-fonts
|
|
|
|
git pull
|
2018-02-26 02:41:29 +01:00
|
|
|
else
|
|
|
|
git clone https://github.com/powerline/fonts.git /opt/powerline-shell-fonts
|
|
|
|
fi
|
|
|
|
cd /opt/powerline-shell-fonts
|
|
|
|
./install.sh
|
|
|
|
cd /
|
|
|
|
|
|
|
|
# uncrustify
|
|
|
|
if [ -d /opt/uncrustify ];then
|
|
|
|
echo "Bereits vorhanden!!!"
|
2018-03-10 22:13:56 +01:00
|
|
|
cd /opt/uncrustify
|
|
|
|
git pull
|
2018-02-26 02:41:29 +01:00
|
|
|
else
|
|
|
|
git clone https://github.com/uncrustify/uncrustify.git /opt/uncrustify
|
|
|
|
fi
|
|
|
|
cd /opt/uncrustify
|
|
|
|
mkdir -p build
|
|
|
|
cd build
|
|
|
|
cmake ..
|
|
|
|
cmake --build .
|
|
|
|
if [ -f /usr/bin/uncrustify ]; then
|
|
|
|
echo "Bereits vorhanden!!!"
|
|
|
|
else
|
|
|
|
ln -s /opt/uncrustify/build/uncrustify /usr/bin/uncrustify
|
|
|
|
fi
|
|
|
|
chmod +x /usr/bin/uncrustify
|
|
|
|
cd /
|
|
|
|
|
2018-03-10 22:13:56 +01:00
|
|
|
# conky
|
|
|
|
if [ -d /opt/conky ];then
|
|
|
|
echo "Bereits vorhanden!!!"
|
|
|
|
cd /opt/conky
|
|
|
|
git pull
|
|
|
|
else
|
|
|
|
git clone https://github.com/brndnmtthws/conky.git /opt/conky
|
|
|
|
fi
|
|
|
|
cd /opt/conky
|
|
|
|
cp cmake/ConkyBuildOptions.cmake .
|
|
|
|
|
|
|
|
sed "s|option(BUILD_LUA_CAIRO \"Build cairo bindings for Lua\" false)|option(BUILD_LUA_CAIRO \"Build cairo bindings for Lua\" true)|g;
|
|
|
|
s|option(BUILD_LUA_IMLIB2 \"Build Imlib2 bindings for Lua\" false)|option(BUILD_LUA_IMLIB2 \"Build Imlib2 bindings for Lua\" true)|g;
|
|
|
|
s|option(BUILD_LUA_RSVG \"Build rsvg bindings for Lua\" false)|option(BUILD_LUA_RSVG \"Build rsvg bindings for Lua\" true)|g" ConkyBuildOptions.cmake > cmake/ConkyBuildOptions.cmake
|
|
|
|
|
2018-03-10 22:20:35 +01:00
|
|
|
if [ -d build ];then
|
|
|
|
rm -Rv build
|
|
|
|
fi
|
2018-03-10 22:13:56 +01:00
|
|
|
mkdir -p build
|
|
|
|
cd build
|
|
|
|
cmake ..
|
|
|
|
make
|
|
|
|
make install
|
|
|
|
|
|
|
|
cd /
|
|
|
|
|
2018-02-26 02:41:29 +01:00
|
|
|
# iso_name
|
|
|
|
if [ "${version}" == "libre" ]; then
|
|
|
|
echo "${repo}-libre" > /etc/hostname
|
|
|
|
else
|
|
|
|
echo ${repo} > /etc/hostname
|
|
|
|
fi
|
|
|
|
|
|
|
|
# uefi-boot
|
2018-02-27 22:53:24 +01:00
|
|
|
cp /opt/${repo1}/uefi-boot.sh /usr/bin/uefi-boot
|
2018-02-26 02:41:29 +01:00
|
|
|
chmod 755 /usr/bin/uefi-boot
|
|
|
|
|
|
|
|
# write-partitions manager
|
2018-02-27 22:53:24 +01:00
|
|
|
cp /opt/${repo}/write_cowspace /usr/bin/write_cowspace
|
2018-02-26 02:41:29 +01:00
|
|
|
chmod 755 /usr/bin/write_cowspace
|
|
|
|
|
|
|
|
# installer-/usr/bin/
|
|
|
|
if [ "${version}" == "libre" ]; then
|
2018-02-27 23:03:01 +01:00
|
|
|
sed "s|%VERSION%|-libre|g;" /opt/${repo}/arch-install > /usr/bin/arch-install
|
2018-02-26 02:41:29 +01:00
|
|
|
else
|
2018-02-27 23:03:01 +01:00
|
|
|
sed "s|%VERSION%||g;" /opt/${repo}/arch-install > /usr/bin/arch-install
|
2018-02-26 02:41:29 +01:00
|
|
|
fi
|
|
|
|
chmod 755 /usr/bin/arch-install
|
|
|
|
|
|
|
|
# installer
|
|
|
|
mkdir -p /usr/share/applications/
|
2018-02-27 22:53:24 +01:00
|
|
|
cp /opt/${repo}/arch-install.desktop /usr/share/applications/
|
2018-02-26 02:41:29 +01:00
|
|
|
chmod 755 /usr/share/applications/arch-install.desktop
|
|
|
|
|
|
|
|
# install-picture
|
|
|
|
mkdir -p /usr/share/pixmaps/
|
2018-02-27 22:53:24 +01:00
|
|
|
cp /opt/${repo}/install.png /usr/share/pixmaps/
|
2018-02-26 02:41:29 +01:00
|
|
|
|
|
|
|
# background
|
|
|
|
mkdir -p /usr/share/backgrounds/xfce/
|
2018-02-27 22:53:24 +01:00
|
|
|
cp /opt/${repo}/*.jpg /usr/share/backgrounds/xfce/
|
2018-02-26 05:45:12 +01:00
|
|
|
chmod 755 -Rv /usr/share/backgrounds/xfce/
|
2018-02-26 02:41:29 +01:00
|
|
|
|
|
|
|
# bash.bashrc
|
2018-02-27 22:53:24 +01:00
|
|
|
sed "s|%OS_NAME%|${repo}|g;" /opt/${repo}/bash.bashrc > /etc/bash.bashrc
|
|
|
|
cp /opt/${repo}/.bashrc /root/
|
2018-02-26 02:41:29 +01:00
|
|
|
|
2018-03-06 23:29:50 +01:00
|
|
|
# config.fish
|
2018-03-06 23:41:32 +01:00
|
|
|
mkdir -p /root/.config/fish/
|
2018-03-06 23:29:50 +01:00
|
|
|
cp /opt/${repo}/config.fish /root/.config/fish/config.fish
|
|
|
|
|
2018-02-26 02:41:29 +01:00
|
|
|
# btrfs-swapfile
|
2018-02-27 22:53:24 +01:00
|
|
|
cp /opt/${repo}/btrfs-swapon.service /etc/systemd/system/
|
|
|
|
cp /opt/${repo}/btrfs-swapon /usr/bin/
|
2018-02-26 02:41:29 +01:00
|
|
|
chmod 755 /usr/bin/btrfs-swapon
|
2018-02-27 22:53:24 +01:00
|
|
|
cp /opt/${repo}/btrfs-swapoff /usr/bin/
|
2018-02-26 02:41:29 +01:00
|
|
|
chmod 755 /usr/bin/btrfs-swapoff
|
|
|
|
|
|
|
|
# compress-script
|
2018-02-27 22:53:24 +01:00
|
|
|
cp /opt/${repo}/compress.sh /usr/bin/compress
|
2018-02-26 02:41:29 +01:00
|
|
|
chmod 755 /usr/bin/compress
|
|
|
|
|
|
|
|
# ssh
|
2018-02-27 22:53:24 +01:00
|
|
|
cp /opt/${repo}/sshd_config /etc/ssh/sshd_config
|
2018-02-26 02:41:29 +01:00
|
|
|
|
|
|
|
# .Xmodmap
|
2018-02-27 22:53:24 +01:00
|
|
|
cp /opt/${repo}/.Xmodmap /root/
|
2018-02-26 02:41:29 +01:00
|
|
|
|
|
|
|
# packages
|
2018-02-27 22:53:24 +01:00
|
|
|
cp /opt/${repo}/packages* /etc/
|
2018-02-26 02:41:29 +01:00
|
|
|
|
|
|
|
# snapshot.sh
|
2018-02-27 22:53:24 +01:00
|
|
|
cp /opt/${repo}/snapshot.sh /usr/bin/snapshot
|
2018-02-26 02:41:29 +01:00
|
|
|
chmod 755 /usr/bin/snapshot
|
|
|
|
|
|
|
|
# ip_forward
|
|
|
|
mkdir -p /proc/sys/net/ipv4/
|
|
|
|
echo 1 > /proc/sys/net/ipv4/ip_forward
|
|
|
|
|
2018-02-26 03:41:53 +01:00
|
|
|
# .Conky
|
2018-02-27 22:53:24 +01:00
|
|
|
tar -vxJf /opt/${repo}/.Conky.tar.xz -C /opt/
|
2018-02-26 03:41:53 +01:00
|
|
|
chmod 755 -Rv /opt/.Conky/
|
2018-02-26 04:39:36 +01:00
|
|
|
touch /root/notes.txt
|
2018-02-26 03:41:53 +01:00
|
|
|
|
2018-02-26 02:41:29 +01:00
|
|
|
# .config
|
2018-02-27 22:53:24 +01:00
|
|
|
tar -vxJf /opt/${repo}/.config.tar.xz -C /root/
|
2018-02-26 02:41:29 +01:00
|
|
|
gnomeconfig
|
|
|
|
|
|
|
|
# .xscreensaver
|
2018-02-27 22:53:24 +01:00
|
|
|
cp /opt/${repo}/.xscreensaver /root/
|
2018-02-26 02:41:29 +01:00
|
|
|
|
|
|
|
# hosts
|
2018-02-27 22:53:24 +01:00
|
|
|
cp /opt/${repo}/hosts /etc/
|
2018-02-26 02:41:29 +01:00
|
|
|
|
|
|
|
# santana
|
|
|
|
mkdir -p /usr/share/fonts/TTF/
|
2018-02-27 22:53:24 +01:00
|
|
|
tar -vxJf /opt/${repo}/santana.tar.xz -C /usr/share/fonts/TTF/
|
2018-02-26 02:41:29 +01:00
|
|
|
|
|
|
|
# update-script
|
2018-02-27 22:53:24 +01:00
|
|
|
cp /opt/${repo}/update.sh /usr/bin/update-script
|
2018-02-26 02:41:29 +01:00
|
|
|
chmod 755 /usr/bin/update-script
|
|
|
|
|
|
|
|
# Verzeichnise
|
|
|
|
mkdir -p /root/Downloads
|
|
|
|
mkdir -p /root/Dokumente
|
|
|
|
mkdir -p /root/Bilder
|
|
|
|
mkdir -p /root/Musik
|
|
|
|
mkdir -p /root/Videos
|
|
|
|
|
|
|
|
# adduser.sh
|
2018-02-27 22:53:24 +01:00
|
|
|
cp /opt/${repo}/adduser.sh /usr/bin/adduser
|
2018-02-26 02:41:29 +01:00
|
|
|
chmod 755 /usr/bin/adduser
|
|
|
|
|
2018-03-06 23:41:32 +01:00
|
|
|
# shell-fish
|
|
|
|
chsh -s /usr/bin/fish root
|
|
|
|
chsh -s /usr/bin/fish ${username}
|
|
|
|
|
2018-03-10 20:42:40 +01:00
|
|
|
# Vibrancy Colors
|
|
|
|
tar -vxJf /opt/${repo}/vibrancy-colors.tar.xz -C /usr/share/icons/
|
2018-03-10 21:06:27 +01:00
|
|
|
gtk-update-icon-cache /usr/share/icons/Vibrancy-Colors-Dark/
|
2018-03-10 20:42:40 +01:00
|
|
|
|
2018-02-26 02:41:29 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# custom-bereich standart
|
|
|
|
|
|
|
|
# nano
|
|
|
|
|
|
|
|
echo "include "/usr/share/nano/*.nanorc"" > /etc/nanorc
|
|
|
|
|
|
|
|
# htop
|
|
|
|
|
|
|
|
echo "fields=0 48 17 18 38 39 40 2 46 47 49 1
|
|
|
|
sort_key=46
|
|
|
|
sort_direction=-1
|
|
|
|
hide_threads=0
|
|
|
|
hide_kernel_threads=1
|
|
|
|
hide_userland_threads=0
|
|
|
|
shadow_other_users=0
|
|
|
|
highlight_base_name=1
|
|
|
|
highlight_megabytes=1
|
|
|
|
highlight_threads=1
|
|
|
|
tree_view=1
|
|
|
|
header_margin=1
|
|
|
|
detailed_cpu_time=1
|
|
|
|
color_scheme=0
|
|
|
|
delay=15
|
|
|
|
left_meters=AllCPUs Memory Swap
|
|
|
|
left_meter_modes=1 1 1
|
|
|
|
right_meters=Tasks LoadAverage Uptime
|
|
|
|
right_meter_modes=2 2 2 " > /root/.htoprc
|
|
|
|
|
|
|
|
# ssh
|
|
|
|
|
|
|
|
mkdir -p /root/.ssh
|
|
|
|
echo "ServerAliveInterval 120" > ~/.ssh/config
|
|
|
|
echo "ServerAliveCountMax 15" >> ~/.ssh/config
|
|
|
|
|
|
|
|
# Install rc.local
|
|
|
|
echo "[Unit]
|
|
|
|
Description=/etc/rc.local compatibility
|
|
|
|
|
|
|
|
[Service]
|
|
|
|
Type=oneshot
|
|
|
|
ExecStart=/etc/rc.local
|
|
|
|
RemainAfterExit=yes
|
|
|
|
|
|
|
|
[Install]
|
|
|
|
WantedBy=multi-user.target" > /etc/systemd/system/rc-local.service
|
|
|
|
touch /etc/rc.local
|
|
|
|
chmod +x /etc/rc.local
|
|
|
|
systemctl enable rc-local.service
|
|
|
|
if ! grep '#!' $RCLOCAL; then
|
|
|
|
echo "#!/bin/bash" > $RCLOCAL
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo "Bei bedarf pacman -Sc oder -Scc eingeben um [nicht mehr benötigte]/[alle] unnötige packete zu entfernen!!!"
|
|
|
|
|
|
|
|
#
|
|
|
|
#systemctl start ntpd
|
|
|
|
#ntpd -gq
|
|
|
|
#date
|
|
|
|
#hwclock -w
|
|
|
|
#
|
|
|
|
|
|
|
|
pacman -Syu --needed --noconfirm
|
|
|
|
|
|
|
|
copyconfig
|
|
|
|
|
|
|
|
ldconfigcache
|
|
|
|
|
|
|
|
if [ "${version}" == "libre" ]; then
|
|
|
|
mkinitcpio -p linux-libre
|
|
|
|
else
|
|
|
|
mkinitcpio -p linux
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Fertig!!!"
|
|
|
|
|
|
|
|
exit 0
|