Technically all I'm trying to do is substitute one file with another using a script:
echo "PASSWORD" | sudo -S rm paper_RPG.jar
cp /home/network/PaperAndWaterfallUpdater/paper.jar paper_RPG.jar
First command removes the old paper_RPG.jar
, and second command copies the updated paper paper.jar
from the update folder, renaming it paper_RPG.jar
and leaving it in the same folder where the script is executed.
Yeah, I'm using a password right there because it's really convenient. Suggestions on that are accepted but I already read some and wasn't convinced.
The old file is propperly removed, and the new one is propperly placed (I tried just copying with hopes of overwriting, but old one doesn't overwite and instead both files with the same name remain in the same folder, so I'm also using rm).
However when attempting to execute the jar, I noticed I get an error saying no such file or directory
. Listing local files with ls shows the jar has this weird name after having being copied: 'paper_RPG.jar'$'\r'
how can I fix this?