From 00b50362ba84b10d8bd185817988643f1a0981bd Mon Sep 17 00:00:00 2001 From: Eshan Roy Date: Tue, 19 Nov 2024 09:43:19 +0530 Subject: [PATCH] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20perf(improve):=20user-frie?= =?UTF-8?q?ndly,=20providing=20clear=20feedback=20on=20the=20success=20or?= =?UTF-8?q?=20failure=20of=20the=20operation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- usr/local/bin/snigdhaos-lsb-release | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/usr/local/bin/snigdhaos-lsb-release b/usr/local/bin/snigdhaos-lsb-release index 1aa3e41..3b83720 100755 --- a/usr/local/bin/snigdhaos-lsb-release +++ b/usr/local/bin/snigdhaos-lsb-release @@ -1,11 +1,26 @@ #!/bin/bash +# Define the source and target files +SOURCE_FILE="/usr/local/share/snigdhaos/release/lsb-release-snigdhaos" +TARGET_FILE="/etc/lsb-release" + echo echo "Applying lsb Release..." -echo -sudo cp /usr/local/share/snigdhaos/release/lsb-release-snigdhaos /etc/lsb-release +# Check if the source file exists +if [[ ! -f "$SOURCE_FILE" ]]; then + echo "Error: Source file '$SOURCE_FILE' does not exist." + exit 1 +fi + +# Attempt to copy the source file to the target location +if sudo cp "$SOURCE_FILE" "$TARGET_FILE"; then + echo "Successfully copied $SOURCE_FILE to $TARGET_FILE." +else + echo "Error: Failed to copy $SOURCE_FILE to $TARGET_FILE." + exit 1 +fi echo echo "Task Completed!" -echo \ No newline at end of file +echo