Skip to content

Commit

Permalink
Fixed error message
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenbertolucci committed Aug 26, 2024
1 parent 2df61e1 commit 93d0530
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
9 changes: 8 additions & 1 deletion Auto-update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,15 @@
# Replace the name of the 'your_path_to_the_password_file_goes_here' text below with the name of the file that contains your password
PASSWORD_FILE="your_path_to_the_password_file_goes_here.txt"

# Check if the password file exists
if [ ! -f "$PASSWORD_FILE" ]; then
echo "Error: Password file does not exist. Please use the correct file path."
sleep 3
exit 1
fi

# Read the password from the file
PASSWORD=$(cat "$PASSWORD_FILE")

# Update and upgrade the system
gnome-terminal -- bash -c "echo $PASSWORD | sudo -S apt update && sudo apt upgrade -y; exec bash"
gnome-terminal -- bash -c "echo $PASSWORD | sudo -S apt update && sudo apt upgrade -y; exec bash"
7 changes: 5 additions & 2 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ chmod +x "$SCRIPT_NAME"
cat << EOF > "$DESKTOP_FILE"
[Desktop Entry]
Version=1.0
Name=Your Program
Name=Auto-Update
Comment=Launch Your Program
Exec=$(pwd)/$SCRIPT_NAME
Icon=$(pwd)/$ICON_NAME
Expand All @@ -23,4 +23,7 @@ EOF
# Make the .desktop file executable
chmod +x "$DESKTOP_FILE"

echo "Setup complete! You can now run Auto-Update from the desktop icon. Enjoy, my friend..."
# Set the .desktop file as trusted using gio
gio set "$DESKTOP_FILE" metadata::trusted true

echo "Setup complete! You can now run Auto-Update from the desktop icon. Enjoy, my friend..."

0 comments on commit 93d0530

Please sign in to comment.