diff --git a/Auto-update.sh b/Auto-update.sh index 4deeac8..7a5d5d3 100755 --- a/Auto-update.sh +++ b/Auto-update.sh @@ -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" \ No newline at end of file +gnome-terminal -- bash -c "echo $PASSWORD | sudo -S apt update && sudo apt upgrade -y; exec bash" diff --git a/setup.sh b/setup.sh index 1af6c4f..6875548 100755 --- a/setup.sh +++ b/setup.sh @@ -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 @@ -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..." \ No newline at end of file +# 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..."