357 lines
10 KiB
Bash
357 lines
10 KiB
Bash
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
ask_install () {
|
|
PACKAGE="$1"
|
|
APT_NAME="$2"
|
|
|
|
printf "Install %s? [y/N]: " "$PACKAGE"
|
|
read answer
|
|
case "$answer" in
|
|
y|Y)
|
|
echo "Installing $PACKAGE..."
|
|
sudo apt install -y "$APT_NAME"
|
|
;;
|
|
*)
|
|
echo "Skipping $PACKAGE"
|
|
;;
|
|
esac
|
|
echo
|
|
}
|
|
|
|
install_brave_origin () {
|
|
PACKAGE="Brave Origin"
|
|
printf "Install %s? [y/N]: " "$PACKAGE"
|
|
read answer
|
|
case "$answer" in
|
|
y|Y)
|
|
echo "Installing $PACKAGE..."
|
|
curl -fsS https://dl.brave.com/install.sh | FLAVOR=origin sh
|
|
;;
|
|
*)
|
|
echo "Skipping $PACKAGE"
|
|
;;
|
|
esac
|
|
echo
|
|
}
|
|
|
|
install_discord () {
|
|
PACKAGE="Discord"
|
|
DISCORD_URL="https://discord.com/api/download?platform=linux&format=deb"
|
|
DEB_FILE="discord_latest_amd64.deb"
|
|
printf "Install %s? [y/N]: " "$PACKAGE"
|
|
read answer
|
|
case "$answer" in
|
|
y|Y)
|
|
echo "Installing $PACKAGE..."
|
|
wget -O "$DEB_FILE" "$DISCORD_URL"
|
|
sudo dpkg -i "$DEB_FILE" || sudo apt -f install -y
|
|
rm -f "$DEB_FILE"
|
|
;;
|
|
*)
|
|
echo "Skipping $PACKAGE"
|
|
;;
|
|
esac
|
|
echo
|
|
}
|
|
|
|
install_angry_ip_scanner () {
|
|
PACKAGE="Angry IP Scanner"
|
|
REPO="angryip/ipscan"
|
|
ARCH="amd64"
|
|
printf "Install %s? [y/N]: " "$PACKAGE"
|
|
read answer
|
|
case "$answer" in
|
|
y|Y)
|
|
echo "Installing $PACKAGE..."
|
|
# Get latest release tag from GitHub API
|
|
LATEST_TAG=$(curl -s https://api.github.com/repos/$REPO/releases/latest \
|
|
| grep '"tag_name"' \
|
|
| cut -d '"' -f4)
|
|
|
|
if [ -z "$LATEST_TAG" ]; then
|
|
echo "❌ Failed to determine latest version"
|
|
exit 1
|
|
fi
|
|
# Extract version number (e.g. 3.6.2)
|
|
VERSION="${LATEST_TAG#v}"
|
|
DEB_FILE="ipscan_${VERSION}_${ARCH}.deb"
|
|
DOWNLOAD_URL="https://github.com/$REPO/releases/download/$LATEST_TAG/$DEB_FILE"
|
|
wget -q --show-progress "$DOWNLOAD_URL"
|
|
sudo dpkg -i "$DEB_FILE" || sudo apt -f install -y
|
|
|
|
# Cleanup
|
|
rm -f "$DEB_FILE"
|
|
;;
|
|
*)
|
|
echo "Skipping $PACKAGE"
|
|
;;
|
|
esac
|
|
echo
|
|
}
|
|
|
|
install_onlyoffice () {
|
|
PACKAGE="OnlyOffice"
|
|
printf "Install %s? [y/N]: " "$PACKAGE"
|
|
read answer
|
|
case "$answer" in
|
|
y|Y)
|
|
echo "Installing $PACKAGE..."
|
|
#Create GPG directory
|
|
mkdir -p -m 700 ~/.gnupg
|
|
|
|
#Import the ONLYOFFICE GPG key
|
|
gpg --no-default-keyring \
|
|
--keyring gnupg-ring:/tmp/onlyoffice.gpg \
|
|
--keyserver hkp://keyserver.ubuntu.com:80 \
|
|
--recv-keys CB2DE8E5
|
|
|
|
#Fix permissions and move the keyring
|
|
chmod 644 /tmp/onlyoffice.gpg
|
|
sudo chown root:root /tmp/onlyoffice.gpg
|
|
sudo mv /tmp/onlyoffice.gpg /usr/share/keyrings/onlyoffice.gpg
|
|
|
|
#Add the ONLYOFFICE repository
|
|
echo "deb [signed-by=/usr/share/keyrings/onlyoffice.gpg] https://download.onlyoffice.com/repo/debian squeeze main" \
|
|
| sudo tee /etc/apt/sources.list.d/onlyoffice.list > /dev/null
|
|
|
|
#Update package lists
|
|
sudo apt-get update
|
|
|
|
#Install ONLYOFFICE Desktop Editors
|
|
sudo apt-get install -y onlyoffice-desktopeditors
|
|
|
|
#Remove LibreOffice
|
|
sudo apt purge libreoffice*
|
|
sudo apt autoremove --purge
|
|
rm -rf ~/.config/libreoffice
|
|
rm -rf ~/.cache/libreoffice
|
|
rm -rf ~/.local/share/libreoffice
|
|
;;
|
|
*)
|
|
echo "Skipping $PACKAGE"
|
|
;;
|
|
esac
|
|
echo
|
|
}
|
|
|
|
install_sublime () {
|
|
PACKAGE="Sublime Text Editor"
|
|
printf "Install %s? [y/N]: " "$PACKAGE"
|
|
read answer
|
|
case "$answer" in
|
|
y|Y)
|
|
echo "Installing $PACKAGE..."
|
|
sudo wget -O- https://download.sublimetext.com/sublimehq-pub.gpg | gpg --dearmor | sudo tee /usr/share/keyrings/sublimehq.gpg
|
|
echo 'deb [signed-by=/usr/share/keyrings/sublimehq.gpg] https://download.sublimetext.com/ apt/stable/' | sudo tee /etc/apt/sources.list.d/sublime-text.list
|
|
sudo apt update
|
|
sudo apt install sublime-text
|
|
rm -f ./wget-log
|
|
;;
|
|
*)
|
|
echo "Skipping $PACKAGE"
|
|
;;
|
|
esac
|
|
echo
|
|
}
|
|
|
|
install_joplin () {
|
|
PACKAGE="Joplin"
|
|
printf "Install %s? [y/N]: " "$PACKAGE"
|
|
read answer
|
|
case "$answer" in
|
|
y|Y)
|
|
echo "Installing $PACKAGE..."
|
|
wget -O - https://raw.githubusercontent.com/laurent22/joplin/dev/Joplin_install_and_update.sh | bash
|
|
;;
|
|
*)
|
|
echo "Skipping $PACKAGE"
|
|
;;
|
|
esac
|
|
echo
|
|
}
|
|
|
|
install_flatseal () {
|
|
PACKAGE="Flatseal"
|
|
printf "Install %s? [y/N]: " "$PACKAGE"
|
|
read answer
|
|
case "$answer" in
|
|
y|Y)
|
|
echo "Installing $PACKAGE..."
|
|
if ! command -v flatpak >/dev/null 2>&1; then
|
|
echo "Flatpak not found, installing..."
|
|
sudo apt install -y flatpak
|
|
fi
|
|
if ! flatpak remote-list | grep -q flathub; then
|
|
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
|
|
fi
|
|
flatpak install -y flathub com.github.tchx84.Flatseal
|
|
;;
|
|
*)
|
|
echo "Skipping $PACKAGE"
|
|
;;
|
|
esac
|
|
echo
|
|
}
|
|
|
|
install_stremio () {
|
|
PACKAGE="Stremio"
|
|
printf "Install %s? [y/N]: " "$PACKAGE"
|
|
read answer
|
|
case "$answer" in
|
|
y|Y)
|
|
echo "Installing $PACKAGE..."
|
|
if ! command -v flatpak >/dev/null 2>&1; then
|
|
echo "Flatpak not found, installing..."
|
|
sudo apt install -y flatpak
|
|
fi
|
|
if ! flatpak remote-list | grep -q flathub; then
|
|
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
|
|
fi
|
|
flatpak install -y flathub com.stremio.Stremio
|
|
;;
|
|
*)
|
|
echo "Skipping $PACKAGE"
|
|
;;
|
|
esac
|
|
echo
|
|
}
|
|
|
|
install_balena_etcher () {
|
|
PACKAGE="balenaEtcher"
|
|
REPO="balena-io/etcher"
|
|
printf "Install %s? [y/N]: " "$PACKAGE"
|
|
read answer
|
|
case "$answer" in
|
|
y|Y)
|
|
echo "Installing $PACKAGE..."
|
|
DEB_URL=$(curl -s https://api.github.com/repos/$REPO/releases/latest \
|
|
| grep "browser_download_url.*amd64.deb" \
|
|
| cut -d '"' -f4)
|
|
|
|
if [ -z "$DEB_URL" ]; then
|
|
echo "❌ Failed to determine latest release"
|
|
exit 1
|
|
fi
|
|
DEB_FILE=$(basename "$DEB_URL")
|
|
wget -q --show-progress "$DEB_URL"
|
|
sudo apt install -y "./$DEB_FILE"
|
|
|
|
# Cleanup
|
|
rm -f "$DEB_FILE"
|
|
;;
|
|
*)
|
|
echo "Skipping $PACKAGE"
|
|
;;
|
|
esac
|
|
echo
|
|
}
|
|
|
|
install_tlp () {
|
|
PACKAGE="TLP"
|
|
printf "Install %s? [y/N]: " "$PACKAGE"
|
|
read answer
|
|
case "$answer" in
|
|
y|Y)
|
|
echo "Installing $PACKAGE..."
|
|
# power-profiles-daemon (default on GNOME/KDE) fights TLP over the same settings
|
|
if systemctl list-unit-files power-profiles-daemon.service >/dev/null 2>&1; then
|
|
sudo systemctl disable --now power-profiles-daemon.service || true
|
|
sudo systemctl mask power-profiles-daemon.service
|
|
fi
|
|
sudo apt install -y tlp tlp-rdw
|
|
sudo systemctl enable --now tlp.service
|
|
sudo tlp-stat -s # should show "State = enabled"
|
|
sudo tlp-stat -b || true # battery info
|
|
;;
|
|
*)
|
|
echo "Skipping $PACKAGE"
|
|
;;
|
|
esac
|
|
echo
|
|
}
|
|
|
|
install_vscode () {
|
|
PACKAGE="Visual Studio Code"
|
|
printf "Install %s? [y/N]: " "$PACKAGE"
|
|
read answer
|
|
case "$answer" in
|
|
y|Y)
|
|
echo "Installing $PACKAGE..."
|
|
sudo apt install -y wget gpg apt-transport-https
|
|
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor | sudo tee /usr/share/keyrings/packages.microsoft.gpg > /dev/null
|
|
echo "deb [arch=amd64,arm64,armhf signed-by=/usr/share/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" | sudo tee /etc/apt/sources.list.d/vscode.list > /dev/null
|
|
sudo apt update
|
|
sudo apt install -y code
|
|
sudo rm -f /etc/apt/sources.list.d/vscode.list
|
|
;;
|
|
*)
|
|
echo "Skipping $PACKAGE"
|
|
;;
|
|
esac
|
|
echo
|
|
}
|
|
|
|
install_ufw () {
|
|
PACKAGE="UFW"
|
|
printf "Install %s? [y/N]: " "$PACKAGE"
|
|
read answer
|
|
case "$answer" in
|
|
y|Y)
|
|
echo "Installing $PACKAGE..."
|
|
sudo apt install -y ufw
|
|
sudo ufw default deny incoming
|
|
sudo ufw default allow outgoing
|
|
# If running over SSH, allow the port this session came in on so enabling doesn't kill it
|
|
if [ -n "$SSH_CONNECTION" ]; then
|
|
SSH_PORT=$(echo "$SSH_CONNECTION" | awk '{print $4}')
|
|
sudo ufw allow "$SSH_PORT/tcp"
|
|
fi
|
|
sudo ufw --force enable
|
|
sudo ufw status verbose
|
|
;;
|
|
*)
|
|
echo "Skipping $PACKAGE"
|
|
;;
|
|
esac
|
|
echo
|
|
}
|
|
|
|
echo "Updating package list..."
|
|
sudo apt update
|
|
echo
|
|
|
|
# APT packages
|
|
ask_install "PCManFM" "pcmanfm"
|
|
ask_install "Wireshark" "wireshark"
|
|
ask_install "Flameshot" "flameshot"
|
|
ask_install "Remmina" "remmina"
|
|
ask_install "PuTTY" "putty"
|
|
ask_install "WireGuard" "wireguard"
|
|
ask_install "Steam" "steam"
|
|
ask_install "mpv" "mpv"
|
|
ask_install "Hydrapaper" "hydrapaper"
|
|
ask_install "Thunderbird" "thunderbird"
|
|
ask_install "Firefox ESR" "firefox-esr"
|
|
|
|
# Not in standard Debian repos
|
|
install_brave_origin
|
|
install_discord
|
|
install_angry_ip_scanner
|
|
install_onlyoffice
|
|
install_sublime
|
|
install_joplin
|
|
install_flatseal
|
|
install_stremio
|
|
install_balena_etcher
|
|
install_tlp
|
|
install_vscode
|
|
install_ufw
|
|
|
|
#jexiftoolgui?
|
|
#redshift?
|
|
#wine
|
|
#WineZGUI
|
|
|
|
echo "Finished." |