silence install script
This commit is contained in:
parent
8a6e95a500
commit
c5eabe4a4d
|
|
@ -5,6 +5,8 @@
|
||||||
|
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
|
quiet() { "$@" > /dev/null 2>&1; }
|
||||||
|
|
||||||
SERVICE_NAME="nose-pluto"
|
SERVICE_NAME="nose-pluto"
|
||||||
SERVICE_FILE="$(dirname "$0")/${SERVICE_NAME}.service"
|
SERVICE_FILE="$(dirname "$0")/${SERVICE_NAME}.service"
|
||||||
SYSTEMD_PATH="/etc/systemd/system/${SERVICE_NAME}.service"
|
SYSTEMD_PATH="/etc/systemd/system/${SERVICE_NAME}.service"
|
||||||
|
|
@ -12,20 +14,20 @@ BUN_SYMLINK="/usr/local/bin/bun"
|
||||||
BUN_REAL="$HOME/.bun/bin/bun"
|
BUN_REAL="$HOME/.bun/bin/bun"
|
||||||
|
|
||||||
echo ">> Updating system libraries"
|
echo ">> Updating system libraries"
|
||||||
sudo apt-get update
|
quiet sudo apt-get update
|
||||||
sudo apt-get install -y libcap2-bin
|
quiet sudo apt-get install -y libcap2-bin
|
||||||
sudo apt-get install -y avahi-utils
|
quiet sudo apt-get install -y avahi-utils
|
||||||
|
|
||||||
echo ">> Ensuring bun is available in /usr/local/bin"
|
echo ">> Ensuring bun is available in /usr/local/bin"
|
||||||
if [ ! -x "$BUN_SYMLINK" ]; then
|
if [ ! -x "$BUN_SYMLINK" ]; then
|
||||||
if [ -x "$BUN_REAL" ]; then
|
if [ -x "$BUN_REAL" ]; then
|
||||||
sudo ln -sf "$BUN_REAL" "$BUN_SYMLINK"
|
quiet sudo ln -sf "$BUN_REAL" "$BUN_SYMLINK"
|
||||||
echo "Symlinked $BUN_REAL -> $BUN_SYMLINK"
|
echo "Symlinked $BUN_REAL -> $BUN_SYMLINK"
|
||||||
else
|
else
|
||||||
echo ">> Installing bun at $BUN_REAL"
|
echo ">> Installing bun at $BUN_REAL"
|
||||||
sudo apt install unzip
|
quiet sudo apt install unzip
|
||||||
curl -fsSL https://bun.com/install | bash
|
quiet curl -fsSL https://bun.com/install | bash
|
||||||
sudo ln -sf "$BUN_REAL" "$BUN_SYMLINK"
|
quiet sudo ln -sf "$BUN_REAL" "$BUN_SYMLINK"
|
||||||
echo "Symlinked $BUN_REAL -> $BUN_SYMLINK"
|
echo "Symlinked $BUN_REAL -> $BUN_SYMLINK"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
|
|
@ -33,34 +35,34 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo ">> Setting CAP_NET_BIND_SERVICE on $BUN_REAL"
|
echo ">> Setting CAP_NET_BIND_SERVICE on $BUN_REAL"
|
||||||
sudo setcap 'cap_net_bind_service=+ep' "$BUN_REAL"
|
quiet sudo setcap 'cap_net_bind_service=+ep' "$BUN_REAL"
|
||||||
/usr/sbin/getcap "$BUN_REAL" || true
|
quiet /usr/sbin/getcap "$BUN_REAL" || true
|
||||||
|
|
||||||
echo ">> Installing systemd unit to $SYSTEMD_PATH"
|
echo ">> Installing systemd unit to $SYSTEMD_PATH"
|
||||||
sudo cp "$SERVICE_FILE" "$SYSTEMD_PATH"
|
quiet sudo cp "$SERVICE_FILE" "$SYSTEMD_PATH"
|
||||||
sudo chown root:root "$SYSTEMD_PATH"
|
quiet sudo chown root:root "$SYSTEMD_PATH"
|
||||||
sudo chmod 644 "$SYSTEMD_PATH"
|
quiet sudo chmod 644 "$SYSTEMD_PATH"
|
||||||
|
|
||||||
echo ">> Reloading systemd daemon"
|
echo ">> Reloading systemd daemon"
|
||||||
sudo systemctl daemon-reload
|
quiet sudo systemctl daemon-reload
|
||||||
|
|
||||||
echo ">> Enabling $SERVICE_NAME to start at boot"
|
echo ">> Enabling $SERVICE_NAME to start at boot"
|
||||||
sudo systemctl enable "$SERVICE_NAME"
|
quiet sudo systemctl enable "$SERVICE_NAME"
|
||||||
|
|
||||||
echo ">> Starting (or restarting) $SERVICE_NAME"
|
echo ">> Starting (or restarting) $SERVICE_NAME"
|
||||||
sudo systemctl restart "$SERVICE_NAME"
|
quiet sudo systemctl restart "$SERVICE_NAME"
|
||||||
|
|
||||||
echo ">> Giving NOSE reboot access"
|
echo ">> Giving NOSE reboot access"
|
||||||
echo "nose ALL=(ALL) NOPASSWD: /sbin/reboot, /usr/sbin/reboot" | sudo tee /etc/sudoers.d/nose-reboot
|
echo "nose ALL=(ALL) NOPASSWD: /sbin/reboot, /usr/sbin/reboot" | sudo tee /etc/sudoers.d/nose-reboot > /dev/null
|
||||||
sudo chmod 440 /etc/sudoers.d/nose-reboot
|
quiet sudo chmod 440 /etc/sudoers.d/nose-reboot
|
||||||
|
|
||||||
echo ">> Enabling kiosk mode"
|
echo ">> Enabling kiosk mode"
|
||||||
mkdir -p ~/.config/labwc
|
quiet mkdir -p ~/.config/labwc
|
||||||
cat > ~/.config/labwc/autostart <<'EOF'
|
cat > ~/.config/labwc/autostart <<'EOF'
|
||||||
chromium-browser --noerrdialogs --disable-infobars --kiosk http://localhost
|
chromium-browser --noerrdialogs --disable-infobars --kiosk http://localhost
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
echo ">> Done! Rebooting!"
|
echo ">> Done! Rebooting!"
|
||||||
systemctl status "$SERVICE_NAME" --no-pager -l
|
quiet systemctl status "$SERVICE_NAME" --no-pager -l
|
||||||
sudo nohup reboot >/dev/null 2>&1 &
|
quiet sudo nohup reboot >/dev/null 2>&1 &
|
||||||
exit 0
|
exit 0
|
||||||
Loading…
Reference in New Issue
Block a user