Last active
October 29, 2022 16:32
-
-
Save ohmypxl/d4888af393c30f64ee006486cc68014d to your computer and use it in GitHub Desktop.
Install sampctl dev branch
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
#!/bin/sh | |
show_banner() { | |
clear | |
echo "+------------------------+" | |
echo "| sampctl dev installer |" | |
echo "| version: 0.5 |" | |
echo "| by: Aiura |" | |
echo "+------------------------+" | |
echo | |
} | |
make_temporary_dir() { | |
mkdir .tmp && cd .tmp | |
} | |
prepare_files() { | |
git clone https://github.com/southclaws/sampctl.git -b dev sampctl && cd sampctl | |
go install github.com/go-task/task/v3/cmd/task@latest | |
} &> /dev/null | |
# Need to move the file manually thanks to git new update | |
install_sampctl() { | |
~/go/bin/task install clean | |
sudo mv ~/go/bin/sampctl /usr/bin/sampctl | |
} &> /dev/null | |
# Supress manual update | |
sampctl_supress_update() { | |
sampctl config HideVersionUpdateMessage true | |
} &> /dev/null | |
cleanup_file() { | |
sudo rm -rf ~/go && rm -rf ../../.tmp | |
} | |
show_banner | |
echo "Making temporary dir..." | |
make_temporary_dir | |
echo "Done!" | |
echo | |
echo "Preparing files..." | |
prepare_files | |
echo | |
echo "Installing sampctl dev version..." | |
install_sampctl | |
echo | |
echo "Supressing sampctl update warnings..." | |
sampctl_supress_update | |
echo | |
echo "Cleaning up..." | |
cleanup_file | |
echo "Done!" | |
show_banner | |
sampctl --version | |
echo "Installation complete, enjoy using sampctl dev version!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
FAQ
Q: What's the difference between v4 and v5?
A: the only difference is just no spammy output on v5 and the script will auto disable update check.