Starting on display

This commit is contained in:
Zakary Timson 2024-07-27 20:08:43 +00:00
parent a0c9972b51
commit ae04b18a1d
2 changed files with 75 additions and 20 deletions

View File

@ -2,45 +2,92 @@
# Root check # Root check
if [ "$UID" != "0" ]; then if [ "$UID" != "0" ]; then
echo "Error: Please run as root" echo "Error: Please run as root"
exit 1 exit 1
fi fi
# Setup # Setup
rw rw
./bin/swap-manager.sh
# Install git
if [ -z "$(which git)" ]; then
echo "Installing Git..."
pacman -S --noconfirm git
fi
# Pull repo/dependencies & re-run from there
git status > /dev/null git status > /dev/null
if [ "$?" != "0" ]; then if [ "$?" != "0" ]; then
echo "Missing dependencies, cloning..." echo "Missing dependencies, cloning..."
git clone https://git.zakscode.com/ztimson/PiKVM.git git clone https://git.zakscode.com/ztimson/PiKVM.git
cd PiKVM cd PiKVM
./install.sh
exit
fi
# Fix banner
echo ""
echo "Updating the banner..."
cp motd /etc/motd
# Update Hostname
echo ""
read -p "Change hostname (Blank to skip): " $H
if [ -n "$H" ]; then
sed -i "s/$HOSTNAME/$H" /etc/hostname
sed -i "s/$HOSTNAME/$H" /etc/hosts
fi fi
# Static MAC fix # Static MAC fix
echo "" echo ""
read -p "Enable static MAC (y/n): " YN read -p "Enable static MAC (y/n): " YN
if [ "${YN,,}" == "y" ]; then if [ "${YN,,}" == "y" ]; then
printf "Define vendor ID (defaults to Intel): " && read MAC_PREFIX printf "Define vendor ID (Default (Intel): 80:86:00): " && read MAC_PREFIX
if [ -z "$MAC_PREFIX" ]; then MAC_PREFIX="80:86:00"; fi if [ -z "$MAC_PREFIX" ]; then MAC_PREFIX="80:86:00"; fi
files=( files=(
"/etc/systemd/network/eth0.network" "/etc/systemd/network/eth0.network"
"/etc/systemd/network/wlan0.network" "/etc/systemd/network/wlan0.network"
) )
for file in "${files[@]}"; do for file in "${files[@]}"; do
if [ -n "$(cat $file | grep MACAddress )" ]; then continue; fi if [ -n "$(cat $file | grep MACAddress )" ]; then continue; fi
mac_address=$(printf '%02X:%02X:%02X' $((RANDOM % 256)) $((RANDOM % 256)) $((RANDOM % 256))) mac_address=$(printf '%02X:%02X:%02X' $((RANDOM % 256)) $((RANDOM % 256)) $((RANDOM % 256)))
cat <<EOF >> "$file" cat <<EOF >> "$file"
[Link] [Link]
MACAddress=$MAC_PREFIX:$mac_address MACAddress=$MAC_PREFIX:$mac_address
EOF EOF
done done
fi fi
# pacman -S cronie python-pipx # Access point
# pipx install pillow RPI.GPIO spidev echo ""
read -p "Enable access point on network outage (y/n): " YN
if [ "${YN,,}" == "y" ]; then
pacman -Sy --noconfirm cronie
echo ""
echo "Access Point: $SSID"
while true; do
read -p "Password: " PASSWORD
if [ ${#PASSWORD} -ge 8 ]; then break; fi
echo "Error: Minimum 8 characters"
done
bin/access-point.sh -f --passwd $PASSWORD
fi
./bin/swap-manager.sh --disable echo ""
read -p "Enable E-Ink display (y/n): " YN
if [ "${YN,,}" == "y" ]; then
./bin/swap-manager.sh 1024
pacman -Sy --noconfirm python-pipx
pipx install pillow
pipx install RPI.GPIO
pipx install spidev
./bin/swap-manager.sh --disable
fi
echo ""
echo "Setup Complete! Please reboot..."

8
motd Normal file
View File

@ -0,0 +1,8 @@
██████╗ ██╗██╗ ██╗██╗ ██╗███╗ ███╗
██╔══██╗██║██║ ██╔╝██║ ██║████╗ ████║
██████╔╝██║█████╔╝ ██║ ██║██╔████╔██║
██╔═══╝ ██║██╔═██╗ ╚██╗ ██╔╝██║╚██╔╝██║
██║ ██║██║ ██╗ ╚████╔╝ ██║ ╚═╝ ██║
╚═╝ ╚═╝╚═╝ ╚═╝ ╚═══╝ ╚═╝ ╚═╝