more fixes
This commit is contained in:
parent
cd0632281f
commit
01f072742f
2 changed files with 47 additions and 5 deletions
|
|
@ -1,5 +1,46 @@
|
|||
#!/bin/bash
|
||||
|
||||
sudo hostnamectl set-hostname testthree
|
||||
sudo systemctl restart NetworkManager
|
||||
echo "$hostname"
|
||||
source assets/shell/colors
|
||||
source assets/config/deps/dependencies
|
||||
|
||||
### DEPENDENCY CHECK & INSTALLER
|
||||
|
||||
echo -e "\n ${LCY}Dependency and Privilege Check running...${CRS}\n"
|
||||
|
||||
### PRIVILEGES
|
||||
|
||||
if (( $(id -u) == 0 )); then ### AM I ROOT?
|
||||
echo -e " ${GRN}Privilege check passed...${CRS}\n"
|
||||
|
||||
else
|
||||
echo -e " ${RED}Privilege check failed... Please run script with sudo or as root!${CRS}\n"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
### DEPENDENCIES
|
||||
|
||||
if command -v "$pkgs_check" >/dev/null 2>&1; then
|
||||
echo -e " ${GRN}Dependency check passed...${CRS}\n"
|
||||
|
||||
else
|
||||
echo -e " ${RED}Dependencies not met.${CRS}\n"
|
||||
echo "$pkgs_check"
|
||||
|
||||
while true; do
|
||||
echo -e " ${YEL}Do you wish to install via APT?"
|
||||
read -p " (Y/n) --> " install
|
||||
echo ""
|
||||
if [[ "$install" = "" || "$install" = "y" || "$install" = "Y" ]]; then
|
||||
sudo apt update && sudo apt install -y $pkgs_apt
|
||||
echo -e "\n ${GRN}Dependencies installed. Proceeding...${CRS}\n"
|
||||
break
|
||||
|
||||
elif [[ "$install" == "n" || "$install" = "N" ]]; then
|
||||
echo -e "\n ${RED}Missing dependencies... Exiting!${CRS}\n"
|
||||
exit 1
|
||||
|
||||
else
|
||||
echo -e "\n ${YEL}Invalid response... Try again...\n\n ${GRN}Y ${YEL}= (Yes, install dependencies and continue)\n ${RED}N ${YEL}= (No, don't install dependencies and exit)${CRS}\n "
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
|
@ -19,7 +19,7 @@ fi
|
|||
|
||||
### DEPENDENCIES
|
||||
|
||||
if command -v "$pkgs_check" >/dev/null 2>&1; then
|
||||
if command -v "$pkgs_check" >/dev/null 2>&1; then ### create a FOR loop for pkg check?!
|
||||
echo -e " ${GRN}Dependency check passed...${CRS}\n"
|
||||
|
||||
else
|
||||
|
|
@ -77,7 +77,8 @@ while true; do
|
|||
read -p " Enter new hostname --> " new_hostname
|
||||
sudo sed -i.backup "s/$HOSTNAME/$new_hostname/g" /etc/hosts
|
||||
sudo sed -i.backup "s/$HOSTNAME/$new_hostname/g" /etc/hostname
|
||||
sudo systemctl reload NetworkManager
|
||||
sudo systemctl restart NetworkManager
|
||||
hostname -F /etc/hostname
|
||||
echo -e "\n ${GRN}Host name changed to ${LCY}$(hostname)${CRS}"
|
||||
break
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue