@eshanized: push via push.sh!!!

This commit is contained in:
2024-03-07 11:57:47 +05:30
parent a4ebc91548
commit 38330e237d

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