fix: align with contribution standards
This commit is contained in:
@@ -15,6 +15,9 @@ update_os
|
|||||||
|
|
||||||
msg_info "Installing Dependencies"
|
msg_info "Installing Dependencies"
|
||||||
$STD apt-get install -y \
|
$STD apt-get install -y \
|
||||||
|
curl \
|
||||||
|
sudo \
|
||||||
|
mc \
|
||||||
libusb-1.0-0
|
libusb-1.0-0
|
||||||
msg_ok "Installed Dependencies"
|
msg_ok "Installed Dependencies"
|
||||||
|
|
||||||
@@ -27,14 +30,14 @@ if [[ -z "$ASSET_URL" ]]; then
|
|||||||
msg_error "Could not locate a Linux x64 release from the Bitfocus API."
|
msg_error "Could not locate a Linux x64 release from the Bitfocus API."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
msg_ok "Found Companion ${RELEASE}"
|
msg_ok "Found Companion v${RELEASE}"
|
||||||
|
|
||||||
msg_info "Downloading Bitfocus Companion ${RELEASE}"
|
msg_info "Downloading Bitfocus Companion v${RELEASE}"
|
||||||
mkdir -p /opt/companion
|
mkdir -p /opt/companion
|
||||||
curl -fsSL "$ASSET_URL" -o /tmp/companion.tar.gz
|
curl -fsSL "$ASSET_URL" -o /tmp/companion.tar.gz
|
||||||
$STD tar -xzf /tmp/companion.tar.gz -C /opt/companion --strip-components=1
|
$STD tar -xzf /tmp/companion.tar.gz -C /opt/companion --strip-components=1
|
||||||
rm -f /tmp/companion.tar.gz
|
rm -f /tmp/companion.tar.gz
|
||||||
msg_ok "Downloaded and Extracted Bitfocus Companion ${RELEASE}"
|
msg_ok "Downloaded and Extracted Bitfocus Companion v${RELEASE}"
|
||||||
|
|
||||||
msg_info "Installing udev Rules"
|
msg_info "Installing udev Rules"
|
||||||
[[ -f /opt/companion/50-companion-headless.rules ]] && cp /opt/companion/50-companion-headless.rules /etc/udev/rules.d/
|
[[ -f /opt/companion/50-companion-headless.rules ]] && cp /opt/companion/50-companion-headless.rules /etc/udev/rules.d/
|
||||||
@@ -72,8 +75,12 @@ EOF
|
|||||||
systemctl enable -q --now companion
|
systemctl enable -q --now companion
|
||||||
msg_ok "Created Service"
|
msg_ok "Created Service"
|
||||||
|
|
||||||
echo "${RELEASE}" >/opt/companion-config/version.txt
|
echo "${RELEASE}" >/opt/companion_version.txt
|
||||||
|
|
||||||
motd_ssh
|
motd_ssh
|
||||||
customize
|
customize
|
||||||
cleanup_lxc
|
|
||||||
|
msg_info "Cleaning up"
|
||||||
|
$STD apt-get -y autoremove
|
||||||
|
$STD apt-get -y autoclean
|
||||||
|
msg_ok "Cleaned"
|
||||||
|
|||||||
Reference in New Issue
Block a user