OSDN Git Service

respect theming setting
[instantos/instantOS.git] / programs / instantupdate
1 #!/bin/bash
2
3 # upgrade instantOS to the next version
4
5 if whoami | grep -q '^root$'; then
6     echo "please do not run instantupdate as root"
7     exit 1
8 fi
9 if ! checkinternet; then
10     echo "internet is required to upgrade instantOS"
11     exit 1
12 fi
13
14 sudo pacman -Sy --noconfirm
15
16 instantshell
17 sudo pacman -Syuu --noconfirm
18 command -v yay && yay
19 instantdotfiles
20
21 if ! iconf -i notheming; then
22     instantthemes a arc
23 fi
24
25 sudo bash /usr/share/instantutils/rootinstall.sh
26 sudo bash /usr/share/instantdotfiles/rootinstall.sh
27 bash /usr/share/instantdotfiles/userinstall.sh
28
29 if ! command -v pacdiff; then
30     sudo pacman -S --noconfirm pacman-contrib
31 fi
32
33 if [ -z "$DIFFPROG" ]; then
34     if ! command -v vim; then
35         export DIFFPROG=nvim
36     fi
37 elif ! command -v "$DIFFPROG"; then
38     export DIFFPROG=nvim
39 fi
40
41 sudo pacdiff
42
43 if grep '..' /etc/pacman.d/mirrorlist | grep -v '^#' | grep -q '..'; then
44     echo "mirrors found"
45 else
46     echo "mirrors have been cleared"
47     cat /usr/share/instantdotfiles/examplemirrors | sudo tee /etc/pacman.d/mirrorlist
48 fi