61 lines
1.4 KiB
Bash
61 lines
1.4 KiB
Bash
#!/bin/bash
|
|
|
|
function nettest {
|
|
echo -e "GET http://google.com HTTP/1.0\n\n" | nc google.com 80 > /dev/null 2>&1
|
|
if [ $? -eq 0 ]; then
|
|
echo "Internet connection confirmed"
|
|
else
|
|
echo "No internet connection available. Script will now exit."
|
|
sleep 2
|
|
exit
|
|
fi
|
|
}
|
|
|
|
function darkmode {
|
|
wget https://raw.githubusercontent.com/Weilbyte/PVEDiscordDark/master/PVEDiscordDark.sh
|
|
bash PVEDiscordDark.sh install
|
|
echo "You will need to refresh the gui for the theme to take affect."
|
|
sleep 2
|
|
}
|
|
|
|
#Remove local-pve partition, resize and partition the disk all in to local.
|
|
function partition {
|
|
pvesm remove local-lvm
|
|
lvremove /dev/pve/data -y
|
|
lvresize -l +100%FREE /dev/pve/root
|
|
resize2fs /dev/mapper/pve-root
|
|
}
|
|
|
|
|
|
##MAIN##
|
|
|
|
#Test for internet connectivity
|
|
|
|
|
|
nettest
|
|
|
|
cat <<EOF
|
|
____ ____ _____ _ _ _____ _ _ ___ ____ ____ __ __ ____
|
|
( _ ( _ ( _ ( \/ ( _ ( \/ ) / __( ___(_ _( )( ( _ \
|
|
)___/) /)(_)( ) ( )(_)( ) ( \__ \)__) )( )(__)( )___/
|
|
(__) (_)\_(_____(_/\_(_____(_/\_) (___(____)(__)(______(__)
|
|
EOF
|
|
|
|
#Update respository and upgrade system
|
|
echo -e "\033[1mUpdating the system first\033[0m"
|
|
sudo apt update && sudo apt upgrade -y
|
|
|
|
|
|
#Optional install dark mode
|
|
read -p "Do you want to install dark mode? y/n " answer
|
|
if [ answer == "y" ]; then
|
|
darkmode
|
|
else
|
|
|
|
fi
|
|
|
|
read -p "Would you like to remove local-lvm and use a single parition? y/n " answer
|
|
if [ answer == "y"]; then
|
|
parition
|
|
else
|