#!/bin/bash
-if ! ping -c 1 archlinux.org &>/dev/null; then
+# upgrade instantOS to the next version
+
+if whoami | grep -q '^root$'; then
+ echo "please do not run instantupdate as root"
+ exit 1
+fi
+if ! checkinternet; then
echo "internet is required to upgrade instantOS"
exit 1
fi
-curl -s "https://raw.githubusercontent.com/instantOS/iso-profiles/master/pacclear.sh" | sudo bash
sudo pacman -Sy --noconfirm
instantshell
sudo pacman -Syuu --noconfirm
-instantdotfiles -f
-instantthemes a arc
+command -v yay && yay
+instantdotfiles
+
+if ! iconf -i notheming; then
+ instantthemes a arc
+fi
sudo bash /usr/share/instantutils/rootinstall.sh
sudo bash /usr/share/instantdotfiles/rootinstall.sh
bash /usr/share/instantdotfiles/userinstall.sh
+
+if ! command -v pacdiff; then
+ sudo pacman -S --noconfirm pacman-contrib
+fi
+
+if [ -z "$DIFFPROG" ]; then
+ if ! command -v vim; then
+ export DIFFPROG=nvim
+ fi
+elif ! command -v "$DIFFPROG"; then
+ export DIFFPROG=nvim
+fi
+
+sudo pacdiff
+
+if grep '..' /etc/pacman.d/mirrorlist | grep -v '^#' | grep -q '..'; then
+ echo "mirrors found"
+else
+ echo "mirrors have been cleared"
+ cat /usr/share/instantdotfiles/examplemirrors | sudo tee /etc/pacman.d/mirrorlist
+fi