Last active
March 20, 2025 11:00
-
-
Save jovemfelix/f8ec1eeca65f08597fdf1050256a175a to your computer and use it in GitHub Desktop.
Upgrade CRC with URL sugested to upgrade
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
URL_TMP=$(crc version 2>&1 | grep -oP 'has been published on\s\K.*') | |
TAR_FILE=~/tmp/crc-linux-amd64.tar.xz | |
OUTPUT_FILE=$(which crc) | |
if [ ! -z "$URL_TMP" ] | |
then | |
URL=${URL_TMP::-1} | |
echo "Downloading: ${URL}" | |
curl -L -o $TAR_FILE $URL | |
echo "Extracting : ${TAR_FILE}" | |
tar xvf $TAR_FILE -C ~/tmp | |
sudo cp -f ~/tmp/crc-linux*/crc $OUTPUT_FILE | |
crc version | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
sudo sh -c "echo 'rfelix ALL=(ALL) NOPASSWD:/usr/local/bin/crc-upgrade.sh' > /etc/sudoers.d/rfelix-crc-upgrade"