PiKVM/install.sh

35 lines
746 B
Bash
Raw Normal View History

2024-07-26 23:19:51 -04:00
#!/bin/bash
2024-07-27 09:27:30 -04:00
# Root check
2024-07-26 23:19:51 -04:00
if [ "$UID" != "0" ]; then
echo "Error: Please run as root"
exit 1
fi
2024-07-27 09:27:30 -04:00
# Setup
2024-07-26 23:36:10 -04:00
rw
2024-07-26 23:19:51 -04:00
git clone https://git.zakscode.com/ztimson/PiKVM.git
cd PiKVM
2024-07-27 09:27:30 -04:00
# Static MAC fix
printf "Enable static MAC (y/n): " && read YN
if [ "$YN" =~ [Yy]$ ]; then
printf "Define vendor ID (defaults to Intel): " && read MAC_PREFIX
if [ -z "$MAC_PREFIX" ]; then MAC_PREFIX="80:86:00"; fi
cat <<EOF >> /etc/systemd/network/
[Link]
MACAddress=$(printf '%02X:%02X:%02X' $((RANDOM % 256)) $((RANDOM % 256)) $((RANDOM % 256)))
EOF
cat <<EOF >> /etc/systemd/network/
[Link]
MACAddress=$(printf '%02X:%02X:%02X' $((RANDOM % 256)) $((RANDOM % 256)) $((RANDOM % 256)))
EOF
fi
2024-07-26 23:19:51 -04:00
pacman -S cronie python-pipx
pipx install pillow RPI.GPIO spidev