commit 7f2f9fd99828164df9fe51aa13dc2a02778310c3 Author: superrob1500 Date: Sun Aug 31 17:46:10 2025 +0200 alpine init script diff --git a/alpine-vm-init.sh b/alpine-vm-init.sh new file mode 100644 index 0000000..718479f --- /dev/null +++ b/alpine-vm-init.sh @@ -0,0 +1,29 @@ +#!/bin/sh +#script to auto install dependencies for alpine vms +#v1.0 + +#enable community repo +sed -i '/community/s/^#//' /etc/apk/repositories + +# Check if the uncommenting was successful +if grep -q '^[^#].*community' /etc/apk/repositories; then + echo "Community repository enabled successfully." +else + echo "Failed to enable community repository. Please check the repositories file manually." >&2 + exit 1 +fi + +# Update the package list +echo "Updating package list..." +apk update + +#install open-vm-tools and qemu-guest-agent +apk add open-vm-tools open-vm-tools-guestinfo open-vm-tools-deploypkg qemu-guest-agent + +#enable services on boot +rc-update add open-vm-tools boot +rc-update add qemu-guest-agent boot + +#start services +rc-service open-vm-tools start +rc-service qemu-guest-agent start \ No newline at end of file