From 8998d2b55350b15f2f8a7ea88b68f55bb8eb8815 Mon Sep 17 00:00:00 2001 From: Denis Knauf Date: Thu, 28 May 2020 19:18:04 +0200 Subject: [PATCH] =?UTF-8?q?Historic=20=E2=80=9Ehexopi.sh=E2=80=9D=20remove?= =?UTF-8?q?d.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hexopi.sh | 203 ------------------------------------------------------ 1 file changed, 203 deletions(-) delete mode 100644 hexopi.sh diff --git a/hexopi.sh b/hexopi.sh deleted file mode 100644 index 20f4f81..0000000 --- a/hexopi.sh +++ /dev/null @@ -1,203 +0,0 @@ -#!/usr/bin/env sh -# SPDX-License-Identifier: GPL-3.0 -# Denis Kanuf - -die() { - >&2 printf '\e[1;31mdied: %s\e[0m\n' "$*" - exit 1 -} - -l() { - >&2 printf '\e[1m%s\e[0m\n' "$*" -} - -d() { - >&2 printf '\e[1;34m# %s\e[0m\n' "$*" - "$@" || die "$*" -} - -MNAME=octoprint -MDIR=/var/lib/machines/$MNAME -TDIR=/var/lib/machines/$MNAME-template -DEVPTN='/dev/ttyUSB*' -LICENSE="$(cat < -EOF -)" - -alias OP='d systemd-nspawn --machine=$MNAME --hostname=$MNAME --directory="$MDIR" --tmpfs=/run --tmpfs=/run/lock' - -t_mkdir() { - for d - do - d install -d "$TDIR/$d" - done -} - -############################################################################### - -ho_install() { -d apt install -y systemd-container debootstrap cron-apt dnsmasq - -d dd of=/etc/cron-apt/action.d/6-upgrade <&2 echo "not a container for running octoprint - no device" - exit 0 -elif [ -e "/dev/$device" ] -then - > /local/env echo OCTOPRINT_HOST=0.0.0.0 - >>/local/env echo OCTOPRINT_PORT=$((2000+${device#*USB})) - install -o octoprint -g octoprint -m 700 -d /var/lib/octoprint - /usr/bin/systemctl enable --no-block --now octoprint.service - /usr/bin/systemctl disable octoprint-init.service -else - >&2 echo "Device not found: $device" - exit 1 -fi -} - -############################################################################### - -case "$1" in -install) ho_install ;; -list) ho_list ;; -install_env) ho_environment ;; -*) - >&2 echo "Usage: $0 install" - exit 1 - ;; -esac