os-init/debian.sh
2023-11-19 22:25:32 +01:00

33 lines
597 B
Bash

#!/bin/bash
declare BASE_URL=https://git.netm.ch/m/os-init/raw/branch/main
declare DEBVER=0
showHelp() {
echo "debian.sh"
echo ""
echo "use :"
echo "bash debian.sh [options]"
echo " -b | --base-url url"
}
main() {
DEBVER=$(grep "VERSION_ID=" /etc/os-release | sed 's/"//g' | sed 's/.*=//')
apt update -y
apt install -y wget
wget -O /tmp/init.sh "${BASE_URL}"/debian-"${DEBVER}"/init.sh
bash /tmp/init.sh -b "${BASE_URL}"
rm /tmp/init.sh
}
while [ ${#} -gt 0 ]; do
case ${1} in
--help) showHelp; exit 0;;
-b | --base-url) BASE_URL="${2}"; shift;;
*) shift;;
esac
done
main