wip3
This commit is contained in:
+32
-18
@@ -1,25 +1,39 @@
|
||||
#!/usr/bin/env bash
|
||||
##makedesc: Install ntfy (latest) + ppa
|
||||
|
||||
echo
|
||||
echo "==============================================="
|
||||
echo "Installing ntfy (latest) + ppa..."
|
||||
echo "==============================================="
|
||||
echo
|
||||
set -eo pipefail
|
||||
|
||||
# https://ntfy.sh/docs/install/#general-steps
|
||||
installed() { command -v "$1" >/dev/null 2>&1; }
|
||||
|
||||
installed() {
|
||||
command -v "$1" >/dev/null 2>&1
|
||||
install() {
|
||||
if [ "$(uname -s)" = "Darwin" ]; then
|
||||
echo "ERROR: ntfy apt/ppa install is not supported on macOS. Use 'brew install ntfy' instead." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo
|
||||
echo "==============================================="
|
||||
echo "Installing ntfy"
|
||||
echo "==============================================="
|
||||
echo
|
||||
|
||||
# https://ntfy.sh/docs/install/#general-steps
|
||||
|
||||
installed curl || sudo apt install -y curl
|
||||
|
||||
curl -sSL https://archive.heckel.io/apt/pubkey.txt | sudo apt-key add -
|
||||
sudo apt install -y apt-transport-https
|
||||
sudo sh -c "echo 'deb [arch=amd64] https://archive.heckel.io/apt debian main' > /etc/apt/sources.list.d/archive.heckel.io.list"
|
||||
sudo apt update
|
||||
sudo apt install -y ntfy
|
||||
sudo systemctl enable ntfy
|
||||
sudo systemctl start ntfy
|
||||
|
||||
echo
|
||||
echo "Finish!"
|
||||
echo
|
||||
}
|
||||
|
||||
! installed curl && sudo apt install -y curl
|
||||
|
||||
curl -sSL https://archive.heckel.io/apt/pubkey.txt | sudo apt-key add - && \
|
||||
sudo apt install apt-transport-https && \
|
||||
sudo sh -c "echo 'deb [arch=amd64] https://archive.heckel.io/apt debian main' \
|
||||
> /etc/apt/sources.list.d/archive.heckel.io.list" && \
|
||||
sudo apt update && \
|
||||
sudo apt install ntfy -y && \
|
||||
sudo systemctl enable ntfy && \
|
||||
sudo systemctl start ntfy
|
||||
case "$1" in
|
||||
*) install ;;
|
||||
esac
|
||||
|
||||
Reference in New Issue
Block a user