2024-08-04 20:49:26 +09:00
|
|
|
#!/bin/sh
|
|
|
|
set -eu
|
|
|
|
|
|
|
|
REPO=${REPO:-git@github.com:kou029w/fogtype.com.git}
|
|
|
|
REMOTE_HOST=${REMOTE_HOST:-fogtype.com}
|
|
|
|
PACKAGES="docker-ce docker-compose-plugin tailscale"
|
|
|
|
|
2024-08-30 18:21:39 +09:00
|
|
|
eval "$(
|
|
|
|
apt-config shell APT_CONF_DIR Dir::Etc::parts/d
|
|
|
|
apt-config shell APT_SOURCES_DIR Dir::Etc::sourceparts/d
|
|
|
|
)"
|
|
|
|
|
2024-08-04 20:49:26 +09:00
|
|
|
sudo apt-get update -qq
|
2024-08-30 18:21:39 +09:00
|
|
|
DEBIAN_FRONTEND=noninteractive sudo apt-get install -y -qq git rsync
|
2024-08-04 20:49:26 +09:00
|
|
|
|
|
|
|
git clone "${REPO}" "${HOME}/${REMOTE_HOST}" ||
|
2024-08-30 18:21:39 +09:00
|
|
|
git -C "${HOME}/${REMOTE_HOST}" pull --rebase
|
2024-08-04 20:49:26 +09:00
|
|
|
|
|
|
|
cd "${HOME}/${REMOTE_HOST}"
|
|
|
|
|
|
|
|
sudo rsync -r etc/apt/keyrings/ /usr/share/keyrings/
|
|
|
|
sudo rsync -r etc/apt/apt.conf.d/ "${APT_CONF_DIR}"
|
|
|
|
sudo rsync -r etc/apt/sources.list.d/ "${APT_SOURCES_DIR}"
|
|
|
|
sudo rsync -r etc/docker/ /etc/docker/
|
|
|
|
|
2024-08-30 18:21:39 +09:00
|
|
|
cd -
|
|
|
|
|
2024-08-04 20:49:26 +09:00
|
|
|
sudo apt-get update -qq
|
|
|
|
# shellcheck disable=SC2086
|
2024-08-30 18:21:39 +09:00
|
|
|
DEBIAN_FRONTEND=noninteractive sudo apt-get install -y -qq ${PACKAGES}
|
2024-08-04 20:49:26 +09:00
|
|
|
|
|
|
|
sudo gpasswd -a "$(whoami)" docker
|