Add 'Config/OScheck.sh'
This commit is contained in:
parent
01a8f77802
commit
34090e5d1c
29
Config/OScheck.sh
Normal file
29
Config/OScheck.sh
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
#!/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
|
||||||
Loading…
x
Reference in New Issue
Block a user