Skip to content

Commit 8b6c3db

Browse files
committed
work on install scripts
1 parent ebcfdb7 commit 8b6c3db

5 files changed

Lines changed: 96 additions & 0 deletions

File tree

bin/install-audio-satellite.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/sh
2+
3+
source ./lib.sh
4+
5+
install_default_config snapclient snapcast
6+
start_app snapclient
7+
8+
echo "Do you want to install Airplay (shairport-sync) support? (yes/no)"
9+
read answer
10+
11+
if [ "$answer" = "yes" ]; then
12+
install_default_config shairport-sync shairport-sync
13+
start_app shairport-sync
14+
else
15+
echo "Skipping Airplay (shairport-sync)"
16+
fi
17+
18+
install_default_config watchtower

bin/install-core.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/sh
2+
3+
source ./lib.sh
4+
5+
start_app nginx-proxy-manager
6+
start_app dnsmasq
7+

bin/install-debian.sh

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/bin/sh
2+
3+
echo "This script will install and start Docker. After running it you should install"
4+
echo "individual applications by running 'docker compose up -d' in each application's"
5+
echo "directory, or run an install script for a stack of applications."
6+
echo
7+
echo "This script uses `sudo` to run items as root; you'll be prompted at least once at"
8+
echo "the start to enter your password in order to allow this"
9+
10+
sudo apt update && apt upgrade -y
11+
sudo apt install pwgen -y
12+
13+
if ! command -v docker &> /dev/null; then
14+
echo "Docker not found. Installing Docker..."
15+
16+
sudo apt install -y apt-transport-https ca-certificates curl software-properties-common
17+
18+
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo tee /etc/apt/trusted.gpg.d/docker.asc
19+
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable"
20+
sudo apt update
21+
sudo apt install -y docker-ce docker-ce-cli containerd.io
22+
23+
sudo systemctl start docker
24+
sudo systemctl enable docker
25+
26+
if command -v docker &> /dev/null; then
27+
echo "Docker installed successfully!"
28+
else
29+
echo "Docker installation failed."
30+
exit 1
31+
fi
32+
else
33+
echo "Docker is already installed."
34+
fi

bin/install-zigbee-satellite.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/sh
2+
3+
source ./lib.sh
4+
5+
install_default_config zigbee2mqtt
6+
start_app zigbee2mqtt
7+
8+
install_default_config watchtower
9+
start_app zigbee2mqtt

bin/lib.sh

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# lib.sh
2+
# meant to be included in other scripts and not run directly
3+
# source ./lib.sh
4+
5+
start_app() {
6+
pushd "$1"
7+
if ! docker-compose ps | grep -q 'Up'; then
8+
echo "Docker Compose project is not running. Starting it..."
9+
docker-compose up -d
10+
echo "$1 started."
11+
else
12+
echo "$1 is already running."
13+
fi
14+
15+
popd
16+
}
17+
18+
install_default_config(app, filename) {
19+
if [ -n "$2" ]; then
20+
cp "$1/config/$2.default" "$1/config/$2"
21+
echo "Installed $1/config/$2 - you should review this file for possible configuration changes"
22+
fi
23+
24+
if [ -f "$1/.env.example" ]; then
25+
cp "$1/.env.example" "$1/.env"
26+
echo "installed $1/.env - you should review this file for possible configuration changes"
27+
fi
28+
}

0 commit comments

Comments
 (0)