From c89f80a17e59cc98b006ec0de0ab38e823c55dd0 Mon Sep 17 00:00:00 2001 From: Ionel Andrei Cataon Date: Tue, 2 Dec 2025 19:35:59 +0200 Subject: [PATCH 01/15] # A doua incercare --- txt.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 txt.md diff --git a/txt.md b/txt.md new file mode 100644 index 0000000..e69de29 From e92e4dd018753fefd13051841b40350a1075fd17 Mon Sep 17 00:00:00 2001 From: ionelcataon Date: Tue, 2 Dec 2025 18:09:50 +0000 Subject: [PATCH 02/15] Update README.md --- README.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/README.md b/README.md index 90d5deb..af2953f 100644 --- a/README.md +++ b/README.md @@ -1,4 +1 @@ -On branch main -Your branch is up to date with 'origin/main'. - -nothing to commit, working tree clean +Asa functioneaza \ No newline at end of file From 7f2020f764d2c401656d6b75a312c7c5723f6db7 Mon Sep 17 00:00:00 2001 From: Ionel Andrei Cataon Date: Thu, 4 Dec 2025 18:00:50 +0200 Subject: [PATCH 03/15] Changes --- myWorkspace | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 myWorkspace diff --git a/myWorkspace b/myWorkspace new file mode 100644 index 0000000..9300d95 --- /dev/null +++ b/myWorkspace @@ -0,0 +1,10 @@ +My name is Ione +trying out more commands in vim + +2 +3 +4 +5 + +*Never back down, never what?!* + From 9f9aeb91b95a3876999b0a966eff02d222fe0636 Mon Sep 17 00:00:00 2001 From: Ionel Andrei Cataon Date: Thu, 4 Dec 2025 18:42:27 +0200 Subject: [PATCH 04/15] Made a few changes --- README.md | 4 +++- myWorkspace | 10 ---------- txt.md | 4 ++++ 3 files changed, 7 insertions(+), 11 deletions(-) delete mode 100644 myWorkspace diff --git a/README.md b/README.md index af2953f..936b189 100644 --- a/README.md +++ b/README.md @@ -1 +1,3 @@ -Asa functioneaza \ No newline at end of file +Asa functioneaza[develop 7f2020f] Changes + 1 file changed, 10 insertions(+) + create mode 100644 myWorkspace diff --git a/myWorkspace b/myWorkspace deleted file mode 100644 index 9300d95..0000000 --- a/myWorkspace +++ /dev/null @@ -1,10 +0,0 @@ -My name is Ione -trying out more commands in vim - -2 -3 -4 -5 - -*Never back down, never what?!* - diff --git a/txt.md b/txt.md index e69de29..9d6cccd 100644 --- a/txt.md +++ b/txt.md @@ -0,0 +1,4 @@ +*Never back down, never what?!* +>>> +<<< + From ac323963e0a4ec84d89b6bd0c600b0a2cd370887 Mon Sep 17 00:00:00 2001 From: Ionel Andrei Cataon Date: Thu, 11 Dec 2025 19:46:36 +0200 Subject: [PATCH 05/15] New changes --- comenziLinux.txt | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 comenziLinux.txt diff --git a/comenziLinux.txt b/comenziLinux.txt new file mode 100644 index 0000000..461fc1a --- /dev/null +++ b/comenziLinux.txt @@ -0,0 +1,5 @@ +d +f +g +h +h From 88c2c52751f16a182a5dd4519a91d91a1048d85a Mon Sep 17 00:00:00 2001 From: Ionel Andrei Cataon Date: Thu, 11 Dec 2025 19:48:49 +0200 Subject: [PATCH 06/15] update --- Bash_scripting/1st_script.sh | 6 ++++++ Bash_scripting/test.sh | 21 +++++++++++++++++++++ Bash_scripting/while.sh | 20 ++++++++++++++++++++ 3 files changed, 47 insertions(+) create mode 100755 Bash_scripting/1st_script.sh create mode 100755 Bash_scripting/test.sh create mode 100755 Bash_scripting/while.sh diff --git a/Bash_scripting/1st_script.sh b/Bash_scripting/1st_script.sh new file mode 100755 index 0000000..cd478f0 --- /dev/null +++ b/Bash_scripting/1st_script.sh @@ -0,0 +1,6 @@ +#!/bin/bash +WORD="Hello world" +echo $WORD +echo $USER + + diff --git a/Bash_scripting/test.sh b/Bash_scripting/test.sh new file mode 100755 index 0000000..77e4ef6 --- /dev/null +++ b/Bash_scripting/test.sh @@ -0,0 +1,21 @@ +#!/bin/bash +user=$(whoami) +echo "outputul de la comanda whoami este: " $user +user="myuser" +echo "valoarea variabilei user este acum: " $user + +echo "Ai introdus primul argument: $1" +echo "Ai introdus al doilea argument: $2" + +VREME=("ploua" "innorat" "furtuna" "soare") +echo "Starea vremii este: $(VREME[0])" +echo "Starea vremii este: $(VREME[1])" +echo "Starea vremii este: $(VREME[2])" +echo "Starea vremii este: $(VREME[3])" + +read nume +echo "Numele introus este: $nume" + +read -p "Introdu un nume: " nume +echo "Numele introdus este: $nume" +echo "Numele introdus este: $(nume:-"Niciun nume introdus")" \ No newline at end of file diff --git a/Bash_scripting/while.sh b/Bash_scripting/while.sh new file mode 100755 index 0000000..35fb207 --- /dev/null +++ b/Bash_scripting/while.sh @@ -0,0 +1,20 @@ +#!/bin/bash +x=1 +while (( $x < "10" )) +do + echo "Valoarea lui x este: $x" + x=$(( x+1 )) +done + +ar=(11 15 86 23 45 78) +Lenght=${#ar[@]} +echo "Lungimea array-ului este: $lenght" + +ar=(32 10 132 32 5 7 43 104) +i=0 +lenght=${#ar[@]} +while [ $i -lt $lenght ]; +do + echo "Elementul $i din array este: ${ar[$i]}" + i=$(( i+1)) +done \ No newline at end of file From 4a1a665fded057ef1ee362cca5270fe3d50d32af Mon Sep 17 00:00:00 2001 From: Ionel Andrei Cataon Date: Mon, 15 Dec 2025 18:39:09 +0200 Subject: [PATCH 07/15] MyProject --- Bash_scripting/myproject.sh | 65 +++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100755 Bash_scripting/myproject.sh diff --git a/Bash_scripting/myproject.sh b/Bash_scripting/myproject.sh new file mode 100755 index 0000000..c1a984d --- /dev/null +++ b/Bash_scripting/myproject.sh @@ -0,0 +1,65 @@ +#!/bin/bash +user=$(whoami) +echo "Welcomem, $user. Please enjoy this short presentation! " + +read -p "Please enter a number:" num +if (( num%2==0 )) +then + echo "$num is even" + +else + echo "$num is odd" + +fi + +for (( i=0; i<3; i++ )) +do +read -p "You have three attempts to find the secret recipe, so please enter another number between 1 and 10: " num2 +secret=1 + +if (( num2==secret )) +then + i=3 + echo "You have found the secret recipe of Coca Cola!! ^_^" + +else + echo "You were so close to finding the secret recipe :(" + +fi +done + +echo "Let's try something else. Please type 1 or 0 (1 for false, 0 for true)" + +for (( j=0; j<=2; ++j )) +do + +if (( j==0 )) +then + read -p "Are there any fish with legs? 1 or 0: " Answer + if (( Answer==0 )) + then + echo "Your answer is correct! Mudskippers are the champions of land-walking fish, but we also have the Lungfish, Walking Catfish, Sea Robins, Frogfish or Handifsh" + else + echo "Your answer is not correct, but don't worry, you are not the only one :D" + fi +elif (( j==1 )) +then + read -p "Are there any animals with no toes? 1 or 0: " Answer + if (( Answer!=0 )) + then + echo "Your answer is correct! Horses are commonly known for having just a toe under their hooves, but one toe is still more than none!" + else + echo "Your answer is not correct. There is no animal without any toes. Hooves are modified toenails covering the tips of toes." + fi +else + read -p "Is the blue whale the heaviest animal on this planet? 1 or 0: " Answer + if (( Answer==0 )) + then + echo "Your answer is correct! The second heaviest animal ever to have existed on Earth is the fin whale (Balaenoptera physalus), with some historical estimates reaching up to 130 tons" + else + echo "Your answer is not correct. Blue whales are widely regarded as the heaviest animals to have ever existed on Earth, with recorded weights up to 190 - 200 tons" + fi +fi +done + + From 7402fbf6886d0e842508f6201853d70d61ae1f6e Mon Sep 17 00:00:00 2001 From: Ionel Andrei Cataon Date: Tue, 16 Dec 2025 04:03:09 +0200 Subject: [PATCH 08/15] updated --- Bash_scripting/myproject.sh | 48 +++++++++++++++++++++---------------- 1 file changed, 27 insertions(+), 21 deletions(-) diff --git a/Bash_scripting/myproject.sh b/Bash_scripting/myproject.sh index c1a984d..abf41cb 100755 --- a/Bash_scripting/myproject.sh +++ b/Bash_scripting/myproject.sh @@ -1,9 +1,9 @@ #!/bin/bash user=$(whoami) -echo "Welcomem, $user. Please enjoy this short presentation! " +echo "Welcome, $user. Please enjoy this short presentation! " read -p "Please enter a number:" num -if (( num%2==0 )) +if ((num % 2 == 0)) then echo "$num is even" @@ -12,12 +12,13 @@ else fi -for (( i=0; i<3; i++ )) +attempts=3 +for ((i = 0; i < 3; i++, --attempts)) do -read -p "You have three attempts to find the secret recipe, so please enter another number between 1 and 10: " num2 +read -p "You have $attempts attempts left to find the secret recipe, so please enter another number between 1 and 10: " num2 secret=1 -if (( num2==secret )) +if ((num2 == secret)) then i=3 echo "You have found the secret recipe of Coca Cola!! ^_^" @@ -26,40 +27,45 @@ else echo "You were so close to finding the secret recipe :(" fi + + done -echo "Let's try something else. Please type 1 or 0 (1 for false, 0 for true)" +echo "Let's try something else. Please answer with a *yes* or *no*." +yes=0 +no=1 -for (( j=0; j<=2; ++j )) +for ((j = 0; j <= 2; ++j)) do -if (( j==0 )) +if ((j == 0)) then - read -p "Are there any fish with legs? 1 or 0: " Answer - if (( Answer==0 )) + read -p "Are there any fish with legs?: " Answer + if ((Answer == 0)) then - echo "Your answer is correct! Mudskippers are the champions of land-walking fish, but we also have the Lungfish, Walking Catfish, Sea Robins, Frogfish or Handifsh" + echo "Your answer is correct! Mudskippers are the champions of land-walking fish, but we also have the Lungfish, Walking Catfish, Sea Robins, Frogfish or Handifsh. Visit: https://factanimal.com/wp-content/uploads/2023/07/mudskipper-breathing.jpg" else - echo "Your answer is not correct, but don't worry, you are not the only one :D" + echo "Your answer is not correct, but don't worry, you are not the only one :D. Visit: https://encrypted-tbn0.gstatic.com/licensed-image?q=tbn:ANd9GcR9laMdCqTkfxW005yPkIED-dHsWvq3IcjPToZi130LpKQVlS5JT9W6u-w2ZMCa7JdDPYXUoqwQKakceVaUotuOA6_RCZF1wSfl2Mvoau2PUKen-0U" fi -elif (( j==1 )) +elif ((j == 1)) then - read -p "Are there any animals with no toes? 1 or 0: " Answer - if (( Answer!=0 )) + read -p "Are there any animals with no toes?: " Answer + if ((Answer != 0)) then - echo "Your answer is correct! Horses are commonly known for having just a toe under their hooves, but one toe is still more than none!" + echo "Your answer is correct! Horses are commonly known for having just a toe under their hooves, but one toe is still more than none! Visit: https://i.chzbgr.com/full/10509587456/h1B5A4D29/this-actually-is-my-first-rodeo" else - echo "Your answer is not correct. There is no animal without any toes. Hooves are modified toenails covering the tips of toes." + echo "Your answer is not correct. There is no animal without any toes. Hooves are modified toenails covering the tips of toes. Visit: https://cdn.britannica.com/28/85428-050-40FEA973/Hoof-horse.jpg" fi else - read -p "Is the blue whale the heaviest animal on this planet? 1 or 0: " Answer - if (( Answer==0 )) + read -p "Is the blue whale the heaviest animal on this planet?: " Answer + if ((Answer == 0)) then - echo "Your answer is correct! The second heaviest animal ever to have existed on Earth is the fin whale (Balaenoptera physalus), with some historical estimates reaching up to 130 tons" + echo "Your answer is correct! The second heaviest animal ever to have existed on Earth is the fin whale (Balaenoptera physalus), with some historical estimates reaching up to 130 tons. Visit: https://www.reddit.com/media?url=https%3A%2F%2Fexternal-preview.redd.it%2FU7IzglHNEVnaT_F58bDjHwB8WqMZDyRNeujcpLqP25s.jpg%3Fwidth%3D1080%26crop%3Dsmart%26auto%3Dwebp%26s%3Df77ae8f9652158dd102218fbb58e1bf665b5a1ab" else - echo "Your answer is not correct. Blue whales are widely regarded as the heaviest animals to have ever existed on Earth, with recorded weights up to 190 - 200 tons" + echo "Your answer is not correct. Blue whales are widely regarded as the heaviest animals to have ever existed on Earth, with recorded weights up to 190 - 200 tons. Visit: https://familylifetips.com/wp-content/uploads/2021/07/Whale-Meme-Whale-Hello-There-Family-Life-Tips-Magazine.jpg" fi fi done + From e097a867ffd36e4d40c9600bfa175f7143a9c36b Mon Sep 17 00:00:00 2001 From: Ionel Andrei Cataon Date: Tue, 16 Dec 2025 04:30:33 +0200 Subject: [PATCH 09/15] newUpdates --- Bash_scripting/colors.sh | 13 +++++++++++++ Bash_scripting/myproject.sh | 27 +++++++++++++++++---------- 2 files changed, 30 insertions(+), 10 deletions(-) create mode 100755 Bash_scripting/colors.sh diff --git a/Bash_scripting/colors.sh b/Bash_scripting/colors.sh new file mode 100755 index 0000000..d592461 --- /dev/null +++ b/Bash_scripting/colors.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +# --- Color/Style Variables --- +RED='\e[0;31m' +GREEN='\e[0;32m' +YELLOW='\e[1;33m' # 1 for Bold, 33 for Yellow +NC='\e[0m' # No Color - Reset all attributes + +# --- Usage Example --- +echo -e "${GREEN}SUCCESS:${NC} Configuration loaded successfully." +echo -e "${RED}ERROR:${NC} Failed to connect to database." +echo -e "${YELLOW}WARNING:${NC} Disk space is getting low." +echo -e "This is ${RED}Red ${NC}and this is ${YELLOW}Yellow${NC} text." \ No newline at end of file diff --git a/Bash_scripting/myproject.sh b/Bash_scripting/myproject.sh index abf41cb..8afa971 100755 --- a/Bash_scripting/myproject.sh +++ b/Bash_scripting/myproject.sh @@ -1,6 +1,13 @@ #!/bin/bash + +RED='\e[1;31m' +GREEN='\e[1;32m' +YELLOW='\e[1;33m' +BLUE='\e[1;34m' +NC='\e[0m' + user=$(whoami) -echo "Welcome, $user. Please enjoy this short presentation! " +echo -e "Welcome, ${BLUE}$user${NC}. Please enjoy this short presentation! " read -p "Please enter a number:" num if ((num % 2 == 0)) @@ -21,17 +28,17 @@ secret=1 if ((num2 == secret)) then i=3 - echo "You have found the secret recipe of Coca Cola!! ^_^" + echo -e "${GREEN}You have found the secret recipe of Coca Cola!! ^_^${NC}" else - echo "You were so close to finding the secret recipe :(" + echo -e "${YELLOW}You were so close to finding the secret recipe :(${NC}" fi done -echo "Let's try something else. Please answer with a *yes* or *no*." +echo -e "${BLUE}Let's try something else. Please answer with a *yes* or *no*.${NC}" yes=0 no=1 @@ -43,26 +50,26 @@ then read -p "Are there any fish with legs?: " Answer if ((Answer == 0)) then - echo "Your answer is correct! Mudskippers are the champions of land-walking fish, but we also have the Lungfish, Walking Catfish, Sea Robins, Frogfish or Handifsh. Visit: https://factanimal.com/wp-content/uploads/2023/07/mudskipper-breathing.jpg" + echo -e "${GREEN}Your answer is correct! Mudskippers are the champions of land-walking fish, but we also have the Lungfish, Walking Catfish, Sea Robins, Frogfish or Handifsh.${NC} Visit: https://factanimal.com/wp-content/uploads/2023/07/mudskipper-breathing.jpg" else - echo "Your answer is not correct, but don't worry, you are not the only one :D. Visit: https://encrypted-tbn0.gstatic.com/licensed-image?q=tbn:ANd9GcR9laMdCqTkfxW005yPkIED-dHsWvq3IcjPToZi130LpKQVlS5JT9W6u-w2ZMCa7JdDPYXUoqwQKakceVaUotuOA6_RCZF1wSfl2Mvoau2PUKen-0U" + echo -e "${RED}Your answer is not correct, but don't worry, you are not the only one :D.${NC} Visit: https://encrypted-tbn0.gstatic.com/licensed-image?q=tbn:ANd9GcR9laMdCqTkfxW005yPkIED-dHsWvq3IcjPToZi130LpKQVlS5JT9W6u-w2ZMCa7JdDPYXUoqwQKakceVaUotuOA6_RCZF1wSfl2Mvoau2PUKen-0U" fi elif ((j == 1)) then read -p "Are there any animals with no toes?: " Answer if ((Answer != 0)) then - echo "Your answer is correct! Horses are commonly known for having just a toe under their hooves, but one toe is still more than none! Visit: https://i.chzbgr.com/full/10509587456/h1B5A4D29/this-actually-is-my-first-rodeo" + echo -e "${GREEN}Your answer is correct! Horses are commonly known for having just a toe under their hooves, but one toe is still more than none!${NC} Visit: https://i.chzbgr.com/full/10509587456/h1B5A4D29/this-actually-is-my-first-rodeo" else - echo "Your answer is not correct. There is no animal without any toes. Hooves are modified toenails covering the tips of toes. Visit: https://cdn.britannica.com/28/85428-050-40FEA973/Hoof-horse.jpg" + echo -e "${RED}Your answer is not correct. There is no animal without any toes. Hooves are modified toenails covering the tips of toes.${NC} Visit: https://cdn.britannica.com/28/85428-050-40FEA973/Hoof-horse.jpg" fi else read -p "Is the blue whale the heaviest animal on this planet?: " Answer if ((Answer == 0)) then - echo "Your answer is correct! The second heaviest animal ever to have existed on Earth is the fin whale (Balaenoptera physalus), with some historical estimates reaching up to 130 tons. Visit: https://www.reddit.com/media?url=https%3A%2F%2Fexternal-preview.redd.it%2FU7IzglHNEVnaT_F58bDjHwB8WqMZDyRNeujcpLqP25s.jpg%3Fwidth%3D1080%26crop%3Dsmart%26auto%3Dwebp%26s%3Df77ae8f9652158dd102218fbb58e1bf665b5a1ab" + echo -e "${GREEN}Your answer is correct! The second heaviest animal ever to have existed on Earth is the fin whale (Balaenoptera physalus), with some historical estimates reaching up to 130 tons.${NC} Visit: https://www.reddit.com/media?url=https%3A%2F%2Fexternal-preview.redd.it%2FU7IzglHNEVnaT_F58bDjHwB8WqMZDyRNeujcpLqP25s.jpg%3Fwidth%3D1080%26crop%3Dsmart%26auto%3Dwebp%26s%3Df77ae8f9652158dd102218fbb58e1bf665b5a1ab" else - echo "Your answer is not correct. Blue whales are widely regarded as the heaviest animals to have ever existed on Earth, with recorded weights up to 190 - 200 tons. Visit: https://familylifetips.com/wp-content/uploads/2021/07/Whale-Meme-Whale-Hello-There-Family-Life-Tips-Magazine.jpg" + echo -e "${RED}Your answer is not correct. Blue whales are widely regarded as the heaviest animals to have ever existed on Earth, with recorded weights up to 190 - 200 tons.${NC} Visit: https://familylifetips.com/wp-content/uploads/2021/07/Whale-Meme-Whale-Hello-There-Family-Life-Tips-Magazine.jpg" fi fi done From 3d601f12d200fc5dcf860628dd698f1b3cb2bfd5 Mon Sep 17 00:00:00 2001 From: Ionel Andrei Cataon Date: Tue, 16 Dec 2025 04:32:41 +0200 Subject: [PATCH 10/15] 2ndUpdate --- Bash_scripting/colors.sh | 13 ------------- 1 file changed, 13 deletions(-) delete mode 100755 Bash_scripting/colors.sh diff --git a/Bash_scripting/colors.sh b/Bash_scripting/colors.sh deleted file mode 100755 index d592461..0000000 --- a/Bash_scripting/colors.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -# --- Color/Style Variables --- -RED='\e[0;31m' -GREEN='\e[0;32m' -YELLOW='\e[1;33m' # 1 for Bold, 33 for Yellow -NC='\e[0m' # No Color - Reset all attributes - -# --- Usage Example --- -echo -e "${GREEN}SUCCESS:${NC} Configuration loaded successfully." -echo -e "${RED}ERROR:${NC} Failed to connect to database." -echo -e "${YELLOW}WARNING:${NC} Disk space is getting low." -echo -e "This is ${RED}Red ${NC}and this is ${YELLOW}Yellow${NC} text." \ No newline at end of file From 71ee1e9f9e90e8a5c17a6749233dee03d7ae844b Mon Sep 17 00:00:00 2001 From: Ionel Andrei Cataon Date: Tue, 23 Dec 2025 13:53:53 +0200 Subject: [PATCH 11/15] new updates --- Bash_scripting/updates.sh | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 Bash_scripting/updates.sh diff --git a/Bash_scripting/updates.sh b/Bash_scripting/updates.sh new file mode 100755 index 0000000..9d6b535 --- /dev/null +++ b/Bash_scripting/updates.sh @@ -0,0 +1,28 @@ +#!/bin/bash +release_file=/etc/os-release +logfile=/var/log/updater.log +errorlog=/var/log/updater_errors.log + +check_exit_status() { + local status=$1 + local command_name=$2 + if [ $status -ne 0 ] + then + echo "An error occurred during $command_name, please check the $errorlog file." + exit 1 + fi +} + +if grep -q "Ubuntu" $release_file || grep -q "Debian" $release_file +then + # The host is Debian or Ubuntu + # Run the apt version of the command + sudo apt update 1>>$logfile 2>>$errorlog + check_exit_status $? "apt update" + + sudo apt dist-upgrade -y 1>>$logfile 2>>$errorlog + check_exit_status $? "apt dist-upgrade" + + echo "Update completed successfully!" +f + From 1a9b9aaf079b9a6fba1847e3f0bb09abfd9c74ce Mon Sep 17 00:00:00 2001 From: Ionel Andrei Cataon Date: Tue, 23 Dec 2025 14:22:30 +0200 Subject: [PATCH 12/15] updateno1 --- Bash_scripting/updates.sh | 3 +-- Bash_scripting/updates2.sh | 39 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 2 deletions(-) create mode 100755 Bash_scripting/updates2.sh diff --git a/Bash_scripting/updates.sh b/Bash_scripting/updates.sh index 9d6b535..d724787 100755 --- a/Bash_scripting/updates.sh +++ b/Bash_scripting/updates.sh @@ -24,5 +24,4 @@ then check_exit_status $? "apt dist-upgrade" echo "Update completed successfully!" -f - +fi \ No newline at end of file diff --git a/Bash_scripting/updates2.sh b/Bash_scripting/updates2.sh new file mode 100755 index 0000000..ff8307b --- /dev/null +++ b/Bash_scripting/updates2.sh @@ -0,0 +1,39 @@ +#!/bin/bash +release_file=/etc/os-release +logfile=/var/log/updater.log +errorlog=/var/log/updater_errors.log + +check_exit_status() { + local status=$? + local command_name=$1 + if [ $status -ne 0 ]; then + echo "$(date): An error occurred during $command_name (exit code: $status). Check $errorlog." | tee -a $logfile + exit 1 + fi +} + +echo "$(date): Starting update process..." >> $logfile + +if grep -q "Ubuntu" $release_file || grep -q "Debian" $release_file; then + apt update >> $logfile 2>> $errorlog + check_exit_status "apt update" + + apt dist-upgrade -y >> $logfile 2>> $errorlog + check_exit_status "apt dist-upgrade" + + apt autoremove -y >> $logfile 2>> $errorlog + check_exit_status "apt autoremove" + + apt autoclean >> $logfile 2>> $errorlog + check_exit_status "apt autoclean" + + echo "$(date): Update completed successfully!" | tee -a $logfile + + # Optional: Check if reboot needed + if [ -f /var/run/reboot-required ]; then + echo "$(date): Reboot required for updates to take effect." | tee -a $logfile + fi +else + echo "This system is not Ubuntu or Debian-based. Exiting." | tee -a $logfile + exit 0 +fi \ No newline at end of file From f27dab6748d76e187304ab8616e206ffe45eecde Mon Sep 17 00:00:00 2001 From: Ionel Andrei Cataon Date: Tue, 23 Dec 2025 14:41:16 +0200 Subject: [PATCH 13/15] updated --- autogit.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 autogit.sh diff --git a/autogit.sh b/autogit.sh new file mode 100755 index 0000000..74e33ca --- /dev/null +++ b/autogit.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +# Simple script to add all changes, commit with message "updated", and push + +git add . + +# Check if there are changes to commit +if git diff-index --quiet HEAD --; then + echo "No changes to commit." + exit 0 +fi + +git commit -m "updated" + +git push + +echo "Changes committed and pushed successfully!" From 279a772162b5c4e5302e55e43ade4f398309a516 Mon Sep 17 00:00:00 2001 From: Ionel Andrei Cataon Date: Tue, 23 Dec 2025 14:47:24 +0200 Subject: [PATCH 14/15] updated --- Bash_scripting/autogit.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 Bash_scripting/autogit.sh diff --git a/Bash_scripting/autogit.sh b/Bash_scripting/autogit.sh new file mode 100755 index 0000000..74e33ca --- /dev/null +++ b/Bash_scripting/autogit.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +# Simple script to add all changes, commit with message "updated", and push + +git add . + +# Check if there are changes to commit +if git diff-index --quiet HEAD --; then + echo "No changes to commit." + exit 0 +fi + +git commit -m "updated" + +git push + +echo "Changes committed and pushed successfully!" From c23a81d8e13da84a423b1a32ad9e7411675d5fba Mon Sep 17 00:00:00 2001 From: Ionel Andrei Cataon Date: Tue, 23 Dec 2025 14:48:54 +0200 Subject: [PATCH 15/15] updated --- Bash_scripting/autogit.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Bash_scripting/autogit.sh b/Bash_scripting/autogit.sh index 74e33ca..a2b4412 100755 --- a/Bash_scripting/autogit.sh +++ b/Bash_scripting/autogit.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Simple script to add all changes, commit with message "updated", and push +# Script to add all changes, commit with the message "updated", and push to repo. git add .