29 lines
763 B
Bash
29 lines
763 B
Bash
#!/bin/bash
|
|
|
|
##---------------##
|
|
# Static Vars #
|
|
##---------------##
|
|
|
|
dist=$(grep --color=never -Po "^ID=\K.*" "/etc/os-release")
|
|
dist_ver=$(grep --color=never -Po "^VERSION_ID=\K.*" "/etc/os-release")
|
|
dist_ver="${dist_ver//\"}"
|
|
|
|
|
|
##-----------##
|
|
# Check OS #
|
|
##-----------##
|
|
|
|
if [[ $dist != debian ]] && [[ $dist != alpine ]]; then
|
|
echo $dist
|
|
whiptail --title "Error" --msgbox "Only Debian or Alpine are supported!" 8 78
|
|
clear
|
|
exit
|
|
else
|
|
dist=$(echo $dist | cut -c1 | tr a-z A-Z)$(echo $dist | cut -c2-)
|
|
if (whiptail --title "Info" --yesno "This script is tested on Debian 11 and Alpine 3.18.X, use it on your own risk!\nYou're currently running: $dist $dist_ver. \n\nContinue anyway?" 11 82); then
|
|
echo ""
|
|
else
|
|
clear
|
|
exit
|
|
fi
|
|
fi |