diff --git a/INSTALL-GLACIER.sh b/INSTALL-GLACIER.sh new file mode 100644 index 0000000..37b063b --- /dev/null +++ b/INSTALL-GLACIER.sh @@ -0,0 +1,19 @@ +#!/bin/sh +# Glacier Installation Script + +mkdir /etc/glacier && echo "[ i ] Creating /etc/glacier..." +mkdir /etc/glacier/pkginfo && echo "Creating /etc/glacier/pkginfo..." +chmod +x glacier-install.sh +chmod +x glacier-remove.sh +chmod +x glacier-update.sh +chmod +x glacier-query.sh +echo "[ i ] Installing glacier..." +cp glacier-install.sh glacier-install +cp glacier-remove.sh glacier-remove +cp glacier-update.sh glacier-update +cp glacier-query.sh glacier-query +mv glacier-install /bin +mv glacier-remove /bin +mv glacier-update /bin +mv glacier-query /bin +echo "[ i ] Glacier has finished installing successfully diff --git a/glacier-help.sh b/glacier-help.sh new file mode 100644 index 0000000..4e4b7af --- /dev/null +++ b/glacier-help.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +echo "Glacier Package Manager" +echo "=====================================================================" +echo "An extremely light and fast ackage manager written entirely in shell." +echo "" +echo "glacier-install - Install a program" +echo "glacier-update - Update a program" +echo "glacier-remove - Remove a program" +echo "glacier-query - Query a program" +echo "" +echo "IMPORTANT REMINDER - Glacier is unlike a traditional package manager where you apend a package name to the command. Instead, Glacier will ask you which package you wish to install." +echo "" +echo "Copyright (c) 2022 Everest Linux Developers" +echo "This software includes no warranty whatsoever. See the GNU GPL v3.0 for more information." diff --git a/glacier-install.sh b/glacier-install.sh new file mode 100644 index 0000000..91cb8e5 --- /dev/null +++ b/glacier-install.sh @@ -0,0 +1,26 @@ +#!/bin/sh +# glacier-install +# Script used to fetch installation scripts and run them + +# Require the script to be run as root +if [[ $(/usr/bin/id -u) -ne 0 ]]; then + echo "[ X ] Please run Glacier as root." + exit +fi + +echo "[ ? ] Enter package name:" && read input +echo "[ i ] Downloading $input.tar.gz" +wget https://github.com/everest-linux/glacier-pkgs/raw/main/pkgs/$input.tar.gz || echo "[ X ] Failed to get archive for $input." +echo "[ i ] Unpacking $input.tar.gz..." +tar -xvf $input.tar.gz || echo "[ X ] Failed to unpack archive for $input." +cd $input +chmod +x INSTALL.sh +./INSTALL.sh # Actually executes installation script +echo "[ i ] Cleaning up..." # Status message +mv $input-pkginfo.json /etc/glacier/pkginfo +rm $input.tar.gz +rm INSTALL.sh +rm UPDATE.sh +rm REMOVE.sh # Cleans up installation files +rm LICENSE.md +echo "[ i ] Finished installation of $input." || echo "[ X ] Installation of $input failed." # Indicates success || Indicates failure diff --git a/glacier-query.sh b/glacier-query.sh new file mode 100644 index 0000000..6dd60d2 --- /dev/null +++ b/glacier-query.sh @@ -0,0 +1,6 @@ +#!/bin/sh +# glacier-query +# Script used to query packages on the system + +echo "[ ? ] Enter package name:" && read input +cat /etc/glacier/pkginfo/$input-pkginfo.json diff --git a/glacier-remove.sh b/glacier-remove.sh new file mode 100644 index 0000000..72ead69 --- /dev/null +++ b/glacier-remove.sh @@ -0,0 +1,28 @@ +#!/bin/sh +# glacier-remove +# Script used to uninstall packages + +# Require the script to be run as root + if [[ $(/usr/bin/id -u) -ne 0 ]]; then + echo "[ X ] Please run Glacier as root." + exit + fi + +echo "[ ? ] Enter package name:" && read input +echo "[ i ] Preparing to remove $input..." +wget https://github.com/everest-linux/glacier-pkgs/raw/main/pkgs/$input.tar.gz || echo "[ X ] Failed to prepare $input for removal." +echo "[ i ] Fetching removal instructions..." +tar -xvf $input.tar.gz || echo "[ X ] Failed to fetch removal instructions." +cd $input +chmod +x REMOVE.sh +./REMOVE.sh +echo "[ i ] Cleaning up..." +rm /etc/glacier/pkginfo/$input-pkginfo.json +rm INSTALL.sh +rm UPDATE.sh +rm REMOVE.sh +rm LICENSE.md +rm $input.tar.gz +rm $input-pkginfo.json +rm $input +echo "[ i ] Finished removal of $input." || echo "[ X ] Removal of $input failed." diff --git a/glacier-update.sh b/glacier-update.sh new file mode 100644 index 0000000..9631132 --- /dev/null +++ b/glacier-update.sh @@ -0,0 +1,25 @@ +#!/bin/sh +# glacier-update +# Script used to update packages + +# Require the script to be run as root +if [[ $(/usr/bin/id -u) -ne 0 ]]; then + echo "[ X ] Please run Glacier as root." + exit +fi + +echo "[ ? ] Enter package name:" && read input +echo "[ i ] Downloading $input.tar.gz..." +wget https://github.com/everest-linux/glacier-pkgs/raw/main/pkgs/$input.tar.gz || echo "[ X ] Failed to get archive for $input" +echo "[ i ] Unpacking $input,tar.gz..." +tar -xvf $input.tar.gz || echo "[ X ] Failed to unpack archive for $input." +cd $input +chmod +x UPDATE.sh +./UPDATE.sh +rm /etc/glacier/pkginfo/$input-pkginfo.json +mv $input-pkginfo.json /etc/glacier/pkginfo +rm $input.tar.gz +rm INSTALL.sh +rm UPDATE.sh +rm REMOVE.sh +echo "[ i ] Finished installation of $input." || echo "[ X ] Installation of $input failed."