Compare commits
No commits in common. "fe5ad9f4af0f8cbd7026bb49d9fc2dd574186dba" and "61317b5483ed8cbdb1ffd62207240b3ed41b84e3" have entirely different histories.
fe5ad9f4af
...
61317b5483
25
bin/update
25
bin/update
|
@ -162,13 +162,8 @@ update-system() {
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$password" ]; then
|
|
||||||
echo -e "\033[32;1m=== Starting system update, please enter your password ===\033[0m"
|
echo -e "\033[32;1m=== Starting system update, please enter your password ===\033[0m"
|
||||||
read -sep "Password: " password
|
sudo true
|
||||||
fi
|
|
||||||
|
|
||||||
echo $password | sudo -Sp "" true > /dev/null 2>&1
|
|
||||||
|
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "Could not get sudo..."
|
echo "Could not get sudo..."
|
||||||
return 1
|
return 1
|
||||||
|
@ -180,11 +175,11 @@ update-system() {
|
||||||
# Debian based systems
|
# Debian based systems
|
||||||
command -v apt > /dev/null 2>&1
|
command -v apt > /dev/null 2>&1
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
echo $password | sudo -Sp "" apt update -y
|
sudo apt update -y
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
echo $password | sudo -Sp "" apt upgrade -y
|
sudo apt upgrade -y
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
echo $password | sudo -Sp "" apt autoremove -y
|
sudo apt autoremove -y
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
@ -196,19 +191,17 @@ update-system() {
|
||||||
yay -Syu --noconfirm
|
yay -Syu --noconfirm
|
||||||
yay -Syua --noconfirm
|
yay -Syua --noconfirm
|
||||||
else
|
else
|
||||||
|
|
||||||
command -v pacman > /dev/null 2>&1
|
command -v pacman > /dev/null 2>&1
|
||||||
|
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
echo $password | sudo -Sp "" pacman -Syu --noconfirm
|
sudo pacman -Syu --noconfirm
|
||||||
fi
|
fi
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Fedora based systems
|
# Fedora based systems
|
||||||
command -v dnf > /dev/null 2>&1
|
command -v dnf > /dev/null 2>&1
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
echo $password | sudo -Sp "" dnf upgrade
|
sudo dnf upgrade
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local seconds=$((`date +%s` - $start))
|
local seconds=$((`date +%s` - $start))
|
||||||
|
@ -470,12 +463,6 @@ partial-update() {
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
|
|
||||||
if [ "$1" == "--pass" ]; then
|
|
||||||
shift
|
|
||||||
password=$1
|
|
||||||
shift
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ $# -eq 0 ]; then
|
if [ $# -eq 0 ]; then
|
||||||
_lock_or_error_message
|
_lock_or_error_message
|
||||||
local error_code=$?
|
local error_code=$?
|
||||||
|
|
Loading…
Reference in New Issue