@eshanized: push via push.sh 🎉 !!!

This commit is contained in:
2024-03-07 15:43:11 +05:30
parent 787221e28d
commit 9de3777de5
11 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,59 @@
#!/bin/bash
#set -e
echo
echo "Reinstalling Grub..."
echo
Online=0
file_boolean=0
function check_connectivity() {
local test_ip
local test_count
test_ip="172.217.12.110"
test_count=1
if ping -c ${test_count} ${test_ip} > /dev/null; then
echo "System Online."
Online=1
else
echo "System Offline!"
Online=0
fi
}
function check_file() {
file="/usr/local/share/snigdhaos/grub/grub"
if [[ -f $file ]];then
echo $file " exists"
file_boolean=1
else
echo $file " doesn't exist"
file_boolean=0
fi
}
check_connectivity
check_file
if [ $Online -eq 1 ] ; then
echo "Downloading Default Grub..."
sudo wget https://raw.githubusercontent.com/Snigdha-OS/snigdhaos-updater/master/grub -O $workdir/etc/default/grub
fi
if [ $Online -eq 0 ] && [ $file_boolean -eq 1 ] ; then
sudo cp /usr/local/share/snigdhaos/grub/grub /etc/default/grub
echo "Copied Grub Locally!"
fi
if [ $Online -eq 0 ] && [ $file_boolean -eq 0 ] ; then
echo "Run this script once you are back online"
fi
sudo grub-mkconfig -o /boot/grub/grub.cfg
echo
echo "Task Completed!"
echo

View File

@@ -0,0 +1,57 @@
#!/bin/bash
#set -e
echo
echo "Downloading Latest pacman.conf..."
echo
Online=0
file_boolean=0
function check_connectivity() {
local test_ip
local test_count
test_ip="172.217.12.110"
test_count=1
if ping -c ${test_count} ${test_ip} > /dev/null; then
echo "System Online!"
Online=1
else
echo "System Offline!"
Online=0
fi
}
function check_file() {
file="/usr/local/share/snigdhaos/pacman.conf"
if [[ -f $file ]];then
echo $file " Found."
file_boolean=1
else
echo $file " Not Found!"
file_boolean=0
fi
}
check_connectivity
check_file
if [ $Online -eq 1 ] ; then
echo "Downloading pacman.conf..."
sudo wget https://raw.githubusercontent.com/Snigdha-OS/snigdhaos-updater/master/pacman.conf -O $workdir/etc/pacman.conf
fi
if [ $Online -eq 0 ] && [ $file_boolean -eq 1 ] ; then
sudo cp /usr/local/share/snigdhaos/pacman.conf /etc/pacman.conf
echo "Copied pacman.conf..."
fi
if [ $Online -eq 0 ] && [ $file_boolean -eq 0 ] ; then
echo "Run this script once you are back online!"
fi
echo
echo "Task Completed!"
echo

View File

@@ -0,0 +1,73 @@
#!/bin/bash
#set -e
Online=0
function check_connectivity() {
local test_ip
local test_count
test_ip="172.217.12.110"
test_count=1
if ping -c ${test_count} ${test_ip} > /dev/null; then
echo
echo "System Online!"
echo
Online=1
else
echo
echo "System Offline! Unable To Download snigdhaos-keyring!"
echo
Online=0
fi
}
check_connectivity
if [ $Online -eq 1 ] ; then
echo
echo "Installing snigdhaos-keyring..."
echo
sudo pacman -Sy snigdhaos-keyring --noconfirm
echo
fi
echo
echo "Removing prevoius pacman databases at /var/lib/pacman/sync/*"
echo
sudo rm /var/lib/pacman/sync/*
echo
echo
echo "Removing prevoius /etc/pacman.d/gnupg folder"
echo
sudo rm -rf /etc/pacman.d/gnupg/*
echo
echo
echo "Initializing pacman keys..."
echo
sudo pacman-key --init
echo
echo
echo "Populating keyring..."
echo
sudo pacman-key --populate
echo
echo
echo "Adding Ubuntu keyserver..."
echo
echo "
keyserver hkp://keyserver.ubuntu.com:80" | sudo tee --append /etc/pacman.d/gnupg/gpg.conf
echo
echo "Synchronizing Database..."
echo
sudo pacman -Sy
echo
echo
echo "Task Completed!"
echo

View File

@@ -0,0 +1,30 @@
#!/bin/bash
#set -e
echo
echo "Copying /etc/pacman.d/gnupg/gpg.conf"
echo
file_boolean=0
function check_file() {
file="/usr/local/share/snigdhaos/gpg.conf"
if [[ -f $file ]];then
echo $file " exists"
file_boolean=1
else
echo $file " doesn't exist"
file_boolean=0
fi
}
check_file
if [ $file_boolean -eq 1 ] ; then
sudo cp /usr/local/share/snigdhaos/gpg.conf /etc/pacman.d/gnupg/gpg.conf
echo "/etc/pacman.d/gnupg/gpg.conf copied from local system"
fi
echo
echo "Task Completed!"
echo

View File

@@ -0,0 +1,6 @@
#!/bin/bash
#set -e
sudo /usr/bin/reflector --score 100 --fastest 10 --number 10 --verbose --save /etc/pacman.d/mirrorlist
echo "Task Completed!"

View File

@@ -0,0 +1,10 @@
#!/bin/bash
#set -e
boot=$(bootctl status | grep Product | awk '{printf($2)}')
echo "The system is using $boot to boot."
if [ $boot = "GRUB" ]; then
/usr/bin/grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=snigdhaos --disable-shim-lock --removable
fi

View File

@@ -0,0 +1,30 @@
#!/bin/bash
#set -e
if lsblk | grep -q "/boot/efi" ; then
echo
echo "Reinstalling systemd-boot..."
echo
sudo pacman -S --noconfirm kernel-install-mkinitcpio
sudo bootctl install
sudo reinstall-kernels
if [[ -f /boot/efi/loader/loader.conf ]];then
sudo sed -i "s/#timeout 3/timeout 3/g" /boot/efi/loader/loader.conf
fi
if [[ -f /boot/efi/loader/loader.conf ]];then
sudo sed -i "s/#console-mode keep/console-mode keep/g" /boot/efi/loader/loader.conf
fi
echo
echo "Task Completed!"
echo
else
echo
echo "Task Falied!"
echo "More on: https://wiki.archlinux.org/title/Arch_boot_process"
echo
fi

View File

@@ -0,0 +1,67 @@
#!/bin/bash
#set -e
echo
echo "Reinstalling Grub..."
echo
Online=0
file_boolean=0
function check_connectivity() {
local test_ip
local test_count
test_ip="172.217.12.110"
test_count=1
if ping -c ${test_count} ${test_ip} > /dev/null; then
echo "System Online!"
Online=1
else
echo "System Offline!"
Online=0
fi
}
function check_file() {
file="/usr/local/share/snigdhaos/grub/grub"
if [[ -f $file ]];then
echo $file " Found."
file_boolean=1
else
echo $file " Not Found!"
file_boolean=0
fi
}
check_connectivity
check_file
if [ $Online -eq 1 ] ; then
echo "getting latest /etc/default/grub from github"
sudo wget https://raw.githubusercontent.com/Snigdha-OS/snigdhaos-updater/master/grub -O $workdir/etc/default/grub
fi
if [ $Online -eq 0 ] && [ $file_boolean -eq 1 ] ; then
sudo cp /usr/local/share/snigdhaos/grub/grub /etc/default/grub
echo "Copied Grub From System!"
fi
if [ $Online -eq 0 ] && [ $file_boolean -eq 0 ] ; then
echo "Run this script once you are back online"
fi
sudo pacman -R --noconfirm kernel-install-mkinitcpio
echo
echo "Updating your /boot/grub/grub.cfg to apply the grub default file..."
echo
sudo grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=snigdhaos
sudo grub-mkconfig -o /boot/grub/grub.cfg
echo
echo "Make sure you installed snigdhaos-grub-theme"
echo