2024-07-07 23:33:47 +01:00
|
|
|
#!/bin/sh
|
2024-06-29 03:12:23 +01:00
|
|
|
|
2024-07-07 23:33:47 +01:00
|
|
|
RC='\033[0m'
|
|
|
|
RED='\033[0;31m'
|
2024-06-29 03:12:23 +01:00
|
|
|
|
2024-07-14 06:33:35 +01:00
|
|
|
linutil="https://github.com/ChrisTitusTech/linutil/releases/latest/download/linutil"
|
2024-06-29 03:12:23 +01:00
|
|
|
|
2024-07-07 23:33:47 +01:00
|
|
|
check() {
|
|
|
|
local exit_code=$1
|
|
|
|
local message=$2
|
2024-06-29 03:12:23 +01:00
|
|
|
|
2024-07-07 23:33:47 +01:00
|
|
|
if [ $exit_code -ne 0 ]; then
|
2024-07-15 22:00:28 +01:00
|
|
|
echo -e "${RED}ERROR: $message${RC}"
|
2024-07-07 23:33:47 +01:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
}
|
2024-06-29 03:12:23 +01:00
|
|
|
|
2024-07-07 23:33:47 +01:00
|
|
|
TMPFILE=$(mktemp)
|
|
|
|
check $? "Creating the temporary file"
|
|
|
|
|
|
|
|
curl -fsL $linutil -o $TMPFILE
|
|
|
|
check $? "Downloading linutil"
|
|
|
|
|
|
|
|
chmod +x $TMPFILE
|
|
|
|
check $? "Making linutil executable"
|
|
|
|
|
|
|
|
"$TMPFILE"
|
|
|
|
check $? "Executing linutil"
|
|
|
|
|
|
|
|
rm -f $TMPFILE
|
|
|
|
check $? "Deleting the temporary file"
|