2024-06-26 12:03:29 -04:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
2024-06-26 12:43:53 -04:00
|
|
|
# This is horrid but better than what I had before
|
|
|
|
|
if ! command -v sshpass &> /dev/null || ! command -v pv &> /dev/null || ! command -v git &> /dev/null; then
|
|
|
|
|
if command -v dnf &> /dev/null; then
|
|
|
|
|
sudo dnf -y install sshpass pv git
|
|
|
|
|
elif command -v apt-get &> /dev/null; then
|
|
|
|
|
sudo apt-get -y install sshpass pv git
|
|
|
|
|
else
|
2024-06-26 13:11:19 -04:00
|
|
|
echo -e "\e[31mPackage manager not found. Please install sshpass, pv, and git manually\e[0m"
|
2024-06-26 12:43:53 -04:00
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
fi
|
2024-06-26 12:03:29 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
git clone https://github.com/ION606/VCS.git .ionvcs
|
2024-06-26 12:43:53 -04:00
|
|
|
|
2024-06-26 13:14:34 -04:00
|
|
|
|
2024-06-26 12:43:53 -04:00
|
|
|
# Move files
|
2024-06-26 13:11:19 -04:00
|
|
|
sudo mv .ionvcs/ionsrc.desktop /usr/share/applications/ionsrc.desktop || echo -e "\e[31mFAILED TO MOVE DESKTOP FILE\e[0m"
|
2024-06-26 12:03:29 -04:00
|
|
|
mkdir -p ~/ionsrc
|
2024-06-26 12:43:53 -04:00
|
|
|
mv .ionvcs/* ~/ionsrc/
|
2024-06-26 13:14:34 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
# alias stuff
|
|
|
|
|
alias_line="alias ionvcs='bash ~/ionsrc/run.sh'"
|
|
|
|
|
|
|
|
|
|
if grep -q "^alias ionvcs=" ~/.bashrc; then
|
|
|
|
|
sed -i "s|^alias ionvcs=.*|$alias_line|" ~/.bashrc
|
|
|
|
|
else
|
|
|
|
|
echo "$alias_line" >> ~/.bashrc
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
source ~/.bashrc
|
|
|
|
|
|
2024-06-26 12:43:53 -04:00
|
|
|
|
|
|
|
|
# Clean up
|
|
|
|
|
rm -rf .ionvcs
|
2024-06-26 13:21:01 -04:00
|
|
|
rm ivcs.sh
|