-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdateMirrorlist
More file actions
executable file
·66 lines (51 loc) · 1.52 KB
/
updateMirrorlist
File metadata and controls
executable file
·66 lines (51 loc) · 1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/usr/bin/env bash
RED='\033[0;31m'
GREEN='\033[0;32m'
BLUE='\033[0;34m'
NC='\033[0m'
if ! [ $EUID = 0 ]; then
echo -e "\n${RED}Some operations require root permission!${NC}"
fi
echo -e "${BLUE}"
read -n 1 -rp "Update Arch Mirrorlist? [Y/n] " prompt
# Convert input to lowercase
prompt=${prompt,,}
#Add extra \n if not empty due to "enter" inserting a newline
if [[ -n "$prompt" ]]; then
printf "\n"
fi
if [ "$prompt" == y ] || [ -z "$prompt" ]; then
# Update Arch Mirrorlist
echo -e "\n${BLUE}Updating Arch Mirrorlist${NC}\n"
reflector --protocol https --verbose --latest 25 --sort rate --save /etc/pacman.d/mirrorlist
echo -e "\n${GREEN}Updated Arch Mirrorlist\n"
fi
echo -e "${BLUE}"
read -n 1 -rp "Update EndeavourOS Mirrorlist? [Y/n] " prompt
# Convert input to lowercase
prompt=${prompt,,}
#Add extra \n if not empty due to "enter" inserting a newline
if [[ -n "$prompt" ]]; then
printf "\n"
fi
if [ "$prompt" == y ] || [ -z "$prompt" ]; then
# Update EndeavourOS Mirrorlist
echo -e "\n${BLUE}Updating EndeavourOS Mirrorlist${NC}\n"
eos-rankmirrors --verbose
echo -e "\n${GREEN}Updated EndeavourOS Mirrorlist\n"
fi
echo -e "${BLUE}"
read -n 1 -rp "Update system? [Y/n] " prompt
# Convert input to lowercase
prompt=${prompt,,}
#Add extra \n if not empty due to "enter" inserting a newline
if [[ -n "$prompt" ]]; then
printf "\n"
fi
if [ "$prompt" == y ] || [ -z "$prompt" ]; then
# Update system
echo -e "\n${BLUE}Updating system${NC}\n"
yay -Syyu
echo -e "\n${GREEN}Finished updating"
fi
printf "${NC}"