2023-11-19 18:54:33 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
declare BASE_URL=https://git.netm.ch/m/os-init/raw/branch/main
|
|
|
|
declare UBUNTUVER=0
|
|
|
|
|
|
|
|
showHelp() {
|
|
|
|
echo "ubuntu.sh"
|
|
|
|
echo ""
|
|
|
|
echo "use :"
|
2023-11-19 19:01:32 +00:00
|
|
|
echo "bash ubuntu.sh [options]"
|
2023-11-19 18:54:33 +00:00
|
|
|
echo " -b | --base-url url"
|
|
|
|
}
|
|
|
|
|
|
|
|
main() {
|
|
|
|
UBUNTUVER=$(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}"/ubuntu-"${UBUNTUVER}"/init.sh
|
2023-11-19 19:01:32 +00:00
|
|
|
bash /tmp/init.sh -b "${BASE_URL}"
|
2023-11-19 18:54:33 +00:00
|
|
|
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
|