This commit is contained in:
2026-07-10 15:11:51 +08:00
parent 8bfcf23bc2
commit da17239d7d
148 changed files with 2542 additions and 4873 deletions
+49 -19
View File
@@ -1,28 +1,58 @@
#!/usr/bin/env bash
##makedesc: Install syncthing (latest) + ppa
echo
echo "==============================================="
echo "Installing syncthing (latest) + ppa..."
echo "==============================================="
echo
set -eo pipefail
# https://apt.syncthing.net/
installed() { command -v "$1" >/dev/null 2>&1; }
# Add the release PGP keys:
sudo curl -s -o /usr/share/keyrings/syncthing-archive-keyring.gpg https://syncthing.net/release-key.gpg
download() {
if installed wget; then
wget -q --show-progress "$1" -O "$2"
else
curl -fsSL "$1" -o "$2"
fi
}
# Add the "stable" channel to your APT sources:
echo "deb [signed-by=/usr/share/keyrings/syncthing-archive-keyring.gpg] https://apt.syncthing.net/ syncthing stable" | sudo tee /etc/apt/sources.list.d/syncthing.list
install() {
if [ "$(uname -s)" = "Darwin" ]; then
if installed brew; then
brew install syncthing
brew services start syncthing
else
echo "ERROR: Install Homebrew first." >&2
exit 1
fi
return
fi
# Add the "candidate" channel to your APT sources:
echo "deb [signed-by=/usr/share/keyrings/syncthing-archive-keyring.gpg] https://apt.syncthing.net/ syncthing candidate" | sudo tee /etc/apt/sources.list.d/syncthing.list
echo
echo "==============================================="
echo "Installing syncthing"
echo "==============================================="
echo
# Update and install syncthing:
sudo apt update
sudo apt install -y --autoremove syncthing
# https://apt.syncthing.net/
wget "https://raw.githubusercontent.com/syncthing/syncthing/main/etc/linux-desktop/syncthing-start.desktop" -O $HOME/.local/share/applications/syncthing-start.desktop
wget "https://raw.githubusercontent.com/syncthing/syncthing/main/etc/linux-desktop/syncthing-ui.desktop" -O $HOME/.local/share/applications/syncthing-ui.desktop
ln -sf $HOME/.local/share/applications/syncthing-start.desktop $HOME/.config/autostart/syncthing-start.desktop
# или демоном: https://habr.com/ru/post/350892/
# Add the release PGP keys:
sudo curl -s -o /usr/share/keyrings/syncthing-archive-keyring.gpg https://syncthing.net/release-key.gpg
# Add the channels to APT sources:
echo "deb [signed-by=/usr/share/keyrings/syncthing-archive-keyring.gpg] https://apt.syncthing.net/ syncthing stable" | sudo tee /etc/apt/sources.list.d/syncthing.list
echo "deb [signed-by=/usr/share/keyrings/syncthing-archive-keyring.gpg] https://apt.syncthing.net/ syncthing candidate" | sudo tee /etc/apt/sources.list.d/syncthing.list
sudo apt update
sudo apt install -y --autoremove syncthing
mkdir -p "$HOME/.local/share/applications" "$HOME/.config/autostart"
download "https://raw.githubusercontent.com/syncthing/syncthing/main/etc/linux-desktop/syncthing-start.desktop" "$HOME/.local/share/applications/syncthing-start.desktop"
download "https://raw.githubusercontent.com/syncthing/syncthing/main/etc/linux-desktop/syncthing-ui.desktop" "$HOME/.local/share/applications/syncthing-ui.desktop"
ln -sf "$HOME/.local/share/applications/syncthing-start.desktop" "$HOME/.config/autostart/syncthing-start.desktop"
echo
echo "Finish!"
echo
}
case "$1" in
*) install ;;
esac