-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharch.sh
More file actions
85 lines (58 loc) · 1.7 KB
/
arch.sh
File metadata and controls
85 lines (58 loc) · 1.7 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/bin/bash
#Arch Update Script
#Recording the start time.
start_time=$(date +%s)
#Clear the screen
clear
#Updates
sudo pacman -Syyu --noconfirm
#Waiting two seconds
sleep 2
#Updates Flatpaks
flatpak upgrade -y
#Adding a blank line in the text for cleaner output.
echo -e "\n"
#Waiting two seconds
sleep 2
#Alerting me when Upgrading is done.
echo "Updated on: " && \
#Adding a blank line in the text for cleaner output.
echo -e "\n"
#Showing the date/time when the update is complete
date && \
#Adding a blank line in the text for cleaner output.
echo -e "\n"
#Showing the date on a calendar.
cal && \
#Adding a blank line in the text for cleaner output.
echo -e "\n"
#Alert at the end of the update.
echo "Your software is up-to-date."
#Adding a blank line in text for cleaner output.
echo -e "\n"
#Recording the end time.
end_time=$(date +%s)
#Calculating the time that elapsed.
elapsed_time=$((end_time - start_time))
# Convert to minutes and seconds if elapsed time is greater than 60 seconds
if ((elapsed_time >= 60)); then
minutes=$((elapsed_time / 60))
seconds=$((elapsed_time % 60))
echo "Script completed in $minutes minutes and $seconds seconds."
else
echo "Script completed in $elapsed_time seconds."
fi
#Adding a blank line in text for cleaner output.
echo -e "\n"
#Friendly goodbye message from your friendly neighborhood cow.
cowsay "Have a great day Shane!"
#Adding a blank line in text for cleaner output.
echo -e "\n"
#exiting the script
echo "Press Enter to exit"
#Reading user input
read
#Clearing the screen after finishing.
clear
#I have fastfetch set to run automatically at terminal startup so this will appear as if I have just opened the terminal after upgrading.
fastfetch