CNSA-276-FP/startup.sh

32 lines
978 B
Bash
Raw Normal View History

2024-05-06 11:23:37 -07:00
#!/bin/sh
2024-05-06 21:56:24 -07:00
sudo cp /user/CNSA/CNSA-276-FP/config.ini /config.bak
sudo rm -R /user/CNSA/CNSA-276-FP
2024-05-06 11:23:37 -07:00
2024-05-09 18:39:07 -07:00
#test2
2024-05-06 11:23:37 -07:00
# Function to check internet connectivity
check_internet_connection() {
ping -c 1 1.1.1.1 > /dev/null 2>&1
return $?
}
# Wait for internet connection
while ! check_internet_connection; do
echo "Waiting for internet connection..."
sleep 1 # Wait for 1 seconds before checking again
done
# Internet connection established
echo "Internet connection established. Running the portion of the script that requires it."
# Add your code here that requires an internet connection
2024-05-06 21:56:24 -07:00
sudo mkdir /user/CNSA/CNSA-276-FP/
sudo git clone https://gitea.eggtech.net/eggman20339/CNSA-276-FP.git /user/CNSA/CNSA-276-FP
sudo chmod 777 /user/CNSA/CNSA-276-FP/startup.sh
2024-05-06 11:23:37 -07:00
2024-05-06 21:56:24 -07:00
sudo cp /config.bak /user/CNSA/CNSA-276-FP/config.ini
2024-05-06 11:23:37 -07:00
2024-05-09 18:32:22 -07:00
screen -dmS DoorAuth bash -c "cd /user/CNSA/CNSA-276-FP/ && python3 main.py"
sudo cp /user/CNSA/CNSA-276-FP/startup.sh /user/CNSA/script/startup.sh