Skip to content

Instantly share code, notes, and snippets.

@arbal
Forked from 0k4/rmate.sh
Last active September 3, 2020 22:35
Show Gist options
  • Save arbal/299ecd37a9fac613cdbdb3db5ed27ff0 to your computer and use it in GitHub Desktop.
Save arbal/299ecd37a9fac613cdbdb3db5ed27ff0 to your computer and use it in GitHub Desktop.
Install rmate
# Check effective user, and if not root/0, ask for password up front to avoid interactive prompt along the way.
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root to download rmate to /usr/local/bin/ and make it executable."
sudo -v
fi
# Silently download rmate (implemented as shell script)
sudo curl -sSo /usr/local/bin/rmate https://raw.githubusercontent.com/aurora/rmate/master/rmate
# Make executable
sudo chmod +x /usr/local/bin/rmate
@arbal
Copy link
Author

arbal commented Sep 3, 2020

Added sudo before curl
Added -sS flags after curl
English comments

@arbal
Copy link
Author

arbal commented Sep 3, 2020

Check effective user, and if not root/0, ask for password up front to avoid interactive prompt along the way.

@arbal
Copy link
Author

arbal commented Sep 3, 2020

Run this gist from shell via:

curl -sS https://gist.githubusercontent.com/arbal/299ecd37a9fac613cdbdb3db5ed27ff0/raw | sudo bash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment