change to update format
This commit is contained in:
+24
-10
@@ -2,6 +2,10 @@
|
||||
#
|
||||
# Purpose : MiniServer installer
|
||||
|
||||
# Wrapped in { ...; exit; } so bash reads the whole script up front; the git
|
||||
# pull below can replace this file while it runs.
|
||||
{
|
||||
|
||||
# Print the logo
|
||||
print_logo() {
|
||||
cat << "EOF"
|
||||
@@ -61,15 +65,26 @@ else
|
||||
fi
|
||||
|
||||
echo "Getting the latest version of MiniServer..."
|
||||
rm -rf ~/.local/share/MiniServer
|
||||
git clone https://gitea.young.computer/david/MiniServer.git "$HOME/.local/share/MiniServer" > /dev/null
|
||||
|
||||
mkdir -p "$HOME/.local/bin"
|
||||
cp "$HOME/.local/share/MiniServer/miniserverrefresh" "$HOME/.local/bin/miniserverrefresh"
|
||||
cp "$HOME/.local/share/MiniServer/miniserverupdate" "$HOME/.local/bin/miniserverupdate"
|
||||
if [ -d "$HOME/.local/share/MiniServer/.git" ]; then
|
||||
git -C "$HOME/.local/share/MiniServer" pull
|
||||
else
|
||||
git clone https://gitea.young.computer/david/MiniServer.git "$HOME/.local/share/MiniServer" > /dev/null
|
||||
fi
|
||||
|
||||
cd ~/.local/share/MiniServer
|
||||
|
||||
# Source utility functions (provides install_packages, install_script and other helpers)
|
||||
source utils.sh
|
||||
|
||||
# Install the refresh, update and sibling management scripts to the user's bin
|
||||
mkdir -p "$HOME/.local/bin"
|
||||
install_script "$HOME/.local/share/MiniServer/refresh" "$HOME/.local/bin/refresh"
|
||||
install_script "$HOME/.local/share/MiniServer/update" "$HOME/.local/bin/update"
|
||||
install_script "$HOME/.local/share/MiniServer/sibling" "$HOME/.local/bin/sibling"
|
||||
|
||||
# Replaced by refresh and update
|
||||
rm -f "$HOME/.local/bin/miniserverrefresh" "$HOME/.local/bin/miniserverupdate"
|
||||
|
||||
echo "Updating system..."
|
||||
sudo pacman -Syu --noconfirm
|
||||
|
||||
@@ -94,9 +109,6 @@ if ! yay --version &> /dev/null; then
|
||||
install_yay
|
||||
fi
|
||||
|
||||
# Source utility functions
|
||||
source utils.sh
|
||||
|
||||
# Source package list
|
||||
if [ ! -f "packages.conf" ]; then
|
||||
echo "Error: packages.conf not found!"
|
||||
@@ -170,4 +182,6 @@ if ! ls /usr/lib/modules/$(uname -r) > /dev/null 2>&1; then
|
||||
esac
|
||||
else
|
||||
echo "Kernel is up to date, no reboot needed. You may want to consider a reboot if other significant software was updated or installed."
|
||||
fi
|
||||
fi
|
||||
exit
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user