From bb89239a2309bb51ea3e3b98e203583623743eb1 Mon Sep 17 00:00:00 2001 From: Stefan E Date: Thu, 24 Apr 2025 11:24:11 +0200 Subject: [PATCH] Fix syntax errors and README.md file paths (#2) * fix syntax errors * update README.md to use the correct file name --------- Co-authored-by: sedot42 --- README.md | 16 ++++++++-------- pkgrecover.sh | 8 ++++---- 2 files changed, 12 insertions(+), 12 deletions(-) mode change 100644 => 100755 pkgrecover.sh diff --git a/README.md b/README.md index e84dddd..dfd02ba 100644 --- a/README.md +++ b/README.md @@ -34,10 +34,10 @@ The script have two modes of operation: 3. Run the script with the date of the last successful upgrade as an argument. For example, if the last successful upgrade was on the 27th of May 2024, you would run the script as follows: ```bash # Check first what packages will be reinstalled using the --dry-run option -archlinux-pkgrecover.sh --pacman-db/--paclog "2024-05-27" [--no-db] --dry-run +./pkgrecover.sh --pacman-db/--paclog "2024-05-27" [--no-db] --dry-run # If you are happy with the list of packages that will be reinstalled -archlinux-pkgrecover.sh --pacman-db/--paclog "2024-05-27" [--no-db] +./pkgrecover.sh --pacman-db/--paclog "2024-05-27" [--no-db] ``` # Examples @@ -45,28 +45,28 @@ archlinux-pkgrecover.sh --pacman-db/--paclog "2024-05-27" [--no-db] 1. Using the pacman log file among with the pacman database: ```bash # Check first what packages will be reinstalled using the --dry-run option -archlinux-pkgrecover.sh --paclog "2024-05-27" --dry-run +./pkgrecover.sh --paclog "2024-05-27" --dry-run # If you are happy with the list of packages that will be reinstalled -archlinux-pkgrecover.sh --paclog "2024-05-27" +./pkgrecover.sh --paclog "2024-05-27" ``` 2. Using the pacman log file without the pacman database: ```bash # Check first what packages will be reinstalled using the --dry-run option -archlinux-pkgrecover.sh --paclog "2024-05-27" --no-db --dry-run +./pkgrecover.sh --paclog "2024-05-27" --no-db --dry-run # If you are happy with the list of packages that will be reinstalled -archlinux-pkgrecover.sh --paclog "2024-05-27" --no-db +./pkgrecover.sh --paclog "2024-05-27" --no-db ``` 3. Using the package database: ```bash # Check first what packages will be reinstalled using the --dry-run option -archlinux-pkgrecover.sh --pacman-db "2024-05-27" --dry-run +./pkgrecover.sh --pacman-db "2024-05-27" --dry-run # If you are happy with the list of packages that will be reinstalled -archlinux-pkgrecover.sh --pacman-db "2024-05-27" +./pkgrecover.sh --pacman-db "2024-05-27" ``` # License diff --git a/pkgrecover.sh b/pkgrecover.sh old mode 100644 new mode 100755 index 48a2a48..997fbde --- a/pkgrecover.sh +++ b/pkgrecover.sh @@ -7,17 +7,17 @@ YELLOW='\033[1;33m' directory_check() { #checks to make sure that all the important directories are mounted properly - if [[ ! -d /proc]]; then + if [[ ! -d /proc ]]; then echo -e "${RED} ERROR: /proc is not mounted. upgrading without /proc mounted can cause damage." exit 1 fi - - if [[ ! -d /sys]]; then + + if [[ ! -d /sys ]]; then echo -e "${RED} ERROR: /sys is not mounted. upgrading without /sys mounted can cause damage." exit 1 fi - if [[ ! -d /boot]]; then + if [[ ! -d /boot ]]; then echo -e "${RED} ERROR: /boot is not mounted. upgrading without /boot mounted can cause damage." exit 1 fi