From: xf0r3m Date: Tue, 17 Mar 2026 13:58:42 +0000 (+0100) Subject: Dodanie pliku base.sh X-Git-Url: https://gitweb.morketsmerke.org/?a=commitdiff_plain;h=d3386259e2b00486b9a9e9853d884307d70f0868;p=X270.git Dodanie pliku base.sh --- diff --git a/base.sh b/base.sh new file mode 100644 index 0000000..6a37311 --- /dev/null +++ b/base.sh @@ -0,0 +1,194 @@ +#!/bin/bash + +set -e + +export DEBVER="$1"; +ARCH=$(dpkg --print-architecture); + +if [ $ARCH = "amd64" ]; then + KARCH="amd64"; +else + KARCH="686-pae"; +fi + +cd; +if [ -x /usr/bin/git ]; then + git clone https://git.morketsmerke.org/git/immudex; + git clone https://git.morketsmerke.org/git/X270; +else + apt install git -y + git clone https://git.morketsmerke.org/git/immudex; + git clone https://git.morketsmerke.org/git/X270; +fi +source ~/immudex/versions/template.sh; + +echo "deb http://deb.debian.org/debian/ ${DEBVER} main" > /etc/apt/sources.list; +echo "deb-src http://deb.debian.org/debian/ ${DEBVER} main" >> /etc/apt/sources.list; +echo "deb http://security.debian.org/debian-security ${DEBVER}-security main" >> /etc/apt/sources.list; +echo "deb-src http://security.debian.org/debian-security ${DEBVER}-security main" >> /etc/apt/sources.list; +echo "deb http://deb.debian.org/debian/ ${DEBVER}-updates main" >> /etc/apt/sources.list; +echo "deb-src http://deb.debian.org/debian/ ${DEBVER}-updates main" >> /etc/apt/sources.list; +update_packages; + + +install_packages --no-install-recommends linux-image-${KARCH} live-boot systemd-sysv -y; + +install_packages tzdata locales keyboard-configuration console-setup; + +dpkg-reconfigure tzdata; +dpkg-reconfigure locales; +dpkg-reconfigure keyboard-configuration; +dpkg-reconfigure console-setup; + +install_packages task-desktop task-xfce-desktop; + +#Usunięcie pakietów make oraz gimp - 22.11.2025; +install_packages firejail ufw cryptsetup lsof extlinux grub-efi-amd64 efibootmgr bash-completion etherwake wakeonlan cifs-utils wget figlet vim-gtk3 redshift irssi nmap nfs-common remmina python3-pip ffmpeg debootstrap squashfs-tools xorriso syslinux-efi grub-pc-bin grub-efi-amd64-bin mtools dosfstools chrony python3-venv isolinux rsync mutt openvpn netselect-apt gvfs-backends dnsutils lolcat cdparanoia icedax thunderbird nextcloud-desktop extrepo; + +extrepo enable librewolf; +apt update; +install_packages librewolf; + +if [ -f /usr/bin/youtube-dl ]; then rm /usr/bin/youtube-dl; fi + +ytdlpVer=$(curl https://github.com/yt-dlp/yt-dlp/releases.atom 2>/dev/null | grep '.*$' | sed -n '2p' | sed 's/\ /\n/g' | tail -1 | sed 's,,,'); +wget https://github.com/yt-dlp/yt-dlp/releases/download/${ytdlpVer}/yt-dlp -O /usr/bin/yt-dlp + +#Polityka antyfrankensteinowa - 13.05.2024 +ln -s /usr/bin/yt-dlp /usr/bin/youtube-dl; + +cd; + +git clone https://github.com/xf0r3m/xfcedebian; +cd xfcedebian; +bash install.sh --immudex; + +cd; + +#Wyłączenie narzędzia immudex-autostart-x4notes - 22.11.2025 +cp -vv ~/immudex/tools/bin/immudex-branch /usr/local/bin; +cp -vv ~/immudex/tools/bin/immudex-import-gpgkeys /usr/local/bin; +cp -vv ~/immudex/tools/bin/immudex-import-sshkeys /usr/local/bin; +#cp -vv ~/immudex/tools/bin/immudex-meteo /usr/local/bin; +cp -vv ~/immudex/tools/bin/immudex-morketsmerke /usr/local/bin; +#cp -vv ~/immudex/tools/bin/immudex-motd2 /usr/local/bin; +cp -vv ~/immudex/tools/bin/immudex-padlock /usr/local/bin; +#cp -vv ~/immudex/tools/bin/immudex-pl /usr/local/bin; +cp -vv ~/immudex/tools/bin/immudex-secured-librewolf /usr/local/bin; +#Wyłączenie narzędzia immudex-protected - 22.11.2025 +#cp -vv ~/immudex/tools/bin/immudex-shoutcasts /usr/local/bin; +cp -vv ~/immudex/tools/bin/immudex-version /usr/local/bin; +#Nowe narzędzie immudex-cdrip - 27.08.2025; +#cp -vv ~/immudex/tools/bin/immudex-cdrip /usr/local/bin; +#Wyłaczenie immudex-run - 22.11.2025 +cp -vv ~/immudex/tools/bin/immudex-run /usr/local/bin; + +#Właczenie nowej wersji immudex-ytplay (immudex-ytplay2) - 13.09.2025 +#pythonVersion=$(python3 -V | awk '{printf $2}' | cut -d "." -f 1-2); +#mv /usr/lib/python${pythonVersion}/EXTERNALLY-MANAGED /usr/lib/python${pythonVersion}/EXTERNALLY-MANAGED.old; +#wget https://ftp.morketsmerke.org/youtube-search/youtube_search-2.1.2-py3-none-any.whl -O /tmp/youtube_search-2.1.2-py3-none-any.whl; +#pip install /tmp/youtube_search-2.1.2-py3-none-any.whl; +#mv /usr/lib/python${pythonVersion}/EXTERNALLY-MANAGED.old /usr/lib/python${pythonVersion}/EXTERNALLY-MANAGED; +#cp -vv ~/immudex/tools/bin/immudex-ytplay2 /usr/local/bin; +#ln -s /usr/local/bin/immudex-ytplay2 /usr/local/bin/immudex-ytplay; + +cp -vv ~/immudex/tools/bin/library.sh /usr/local/bin; +#cp -vv ~/immudex/tools/bin/idle-clic /usr/local/bin; +#cp -vv ~/immudex/tools/bin/sync.sh /usr/local/bin; +chmod +x /usr/local/bin/*; + +#cp -vv ~/immudex/tools/sbin/immudex-create-media /usr/local/sbin; +#cp -vv ~/immudex/tools/sbin/immudex-crypt /usr/local/sbin; +cp -vv ~/immudex/tools/sbin/immudex-hostname /usr/local/sbin; +cp -vv ~/immudex/tools/sbin/immudex-install /usr/local/sbin; +cp -vv ~/immudex/tools/sbin/immudex-upgrade /usr/local/sbin; +#Wyłączenie narzędzi immudex-update i immudex-nf - 22.11.2025 +chown root:root /usr/local/sbin/*; +chmod 544 /usr/local/sbin/*; + +wget https://ftp.morketsmerke.org/morketsmerke-keyring.asc -O /usr/share/keyrings/morketsmerke-keyring.asc +echo "deb [signed-by=/usr/share/keyrings/morketsmerke-keyring.asc] http://ftp.morketsmerke.org/debian trixie main" | tee /etc/apt/sources.list.d/morketsmerke.list + +apt update +apt install immudex-tools -y + +ln -s /usr/bin/immudex-motd /usr/bin/immudex-motd2; + +cp -rvv ~/immudex/files/libreoffice /etc/skel/.config; +cp -vv ~/immudex/files/firejail.config /etc/firejail; +cp -vv ~/immudex/files/redshift.conf /etc/skel/.config; +cp -vv ~/immudex/files/redshift.desktop /etc/skel/.config/autostart; + +#cp -rvv ~/immudex/files/sync.sh /usr/share; + +#Polityka antyfrankensteinowa - 13.05.2024 +if [ "$DEBVER" = "testing" ]; then + cp -vv ~/immudex/files/gtk-main.css /usr/share/xfce4/notes/gtk-3.0/gtk.css; +fi + +if [ -f /usr/share/applications/qmmp.desktop ]; then + ln -s /usr/share/applications/qmmp.desktop /usr/share/applications/qmmp-1.desktop; +fi +cp -vv ~/immudex/launchers/*.desktop /usr/share/applications; +cp -vv ~/immudex/files/whiskermenu-1.rc /etc/skel/.config/xfce4/panel/whiskermenu-1.rc; +cp -vv ~/X270/pointers.xml /etc/skel/.config/xfce4/xfconf/xfce-perchannel-xml/pointers.xml +cp -vv ~/X270/xfce4-panel.xml /etc/skel/config/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml + +cp -vv ~/immudex/files/immudex_hostname.service /etc/systemd/system; + +cp -vv ~/immudex/launchers/16844254192.desktop /etc/skel/.config/xfce4/panel/launcher-5; + +tar -xzvf ~/immudex/files/mozilla.tgz -C /etc/skel; + +systemctl enable immudex_hostname.service; + +cat >> /etc/bash.bashrc << EOL +if [ ! -f /tmp/.motd ]; then +/usr/local/bin/immudex-motd2 +touch /tmp/.motd; +fi +EOL + +echo "alias immudex-chhome='export HOME=\$(pwd)'" >> /etc/bash.bashrc; +echo "alias immudex-changelogs='immudex-upgrade --check --print'" >> /etc/bash.bashrc; +echo "alias immudex-version='cat /run/live/medium/live/changelog'" >> /etc/bash.bashrc; +echo "alias teamviewer_prepare='sudo sed -i '/^xf0r3m/s,/home/xf0r3m,/ic0,' /etc/passwd'" >> /etc/bash.bashrc; +echo "alias teamviewer_restore='sudo sed -i '/^xf0r3m/s,/ic0,/home/xf0r3m,' /etc/passwd'" >> /etc/bash.bashrc; + +chmod u+s /usr/bin/ping; + +/usr/sbin/ufw default deny incoming; +/usr/sbin/ufw default allow outgoing; +#/usr/sbin/ufw enable; +sed -i '/^ENABLED=/s/ENABLED=no/ENABLED=yes/' /etc/ufw/ufw.conf + +echo "TP-X270" > /etc/hostname; +echo "127.0.1.1 TP-X270" >> /etc/hosts; + +# Zmiany można umieścić również tutaj jeśli dotyczą one użytkowników lub ich +# plików konfiguracyjnych + +echo -n "Username: "; +read username; +useradd -m -s /bin/bash $username; +cp -r /etc/skel/.??* /home/${username}; +chown -R ${username}:${username} /home/${username}; +passwd $username; +usermod -aG sudo $username; + + +dd if=/dev/random bs=1M of=random count=1; +rootPassword=$(md5sum random | awk '{printf $1}'); +rm random; +echo "root:${rootPassword}" | chpasswd; +usermod -L root; + +# Miejsce na twoje zmiany, przed poleceniem 'tidy' +cd /tmp +wget https://download.teamviewer.com/download/linux/teamviewer_amd64.deb +apt install -y ./teamviewer_amd64.deb +kill $(pidof gpg-agent) + +bash ~/immudex/addons/iwlwifi; + +tidy;