35 lines
934 B
Bash
Executable File
35 lines
934 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
run_directory=$(dirname $(readlink -f "$0"))
|
|
user=$(whoami)
|
|
|
|
if [ -f $run_directory/.disabled ]; then
|
|
echo "Installation is disabled. Exiting..."
|
|
exit 0
|
|
fi
|
|
|
|
if [[ $user != 'root' ]]; then
|
|
echo "Copying rcs to home directory..."
|
|
cp $run_directory/bashrc /home/$user/.bashrc
|
|
cp $run_directory/vimrc /home/$user/.vimrc
|
|
cp $run_directory/tmux.conf /home/$user/.tmux.conf
|
|
|
|
if ! command -v sudo &> /dev/null; then
|
|
echo "Could not copy to root directory: sudo was not found."
|
|
else
|
|
echo "Copying rcs to root directory..."
|
|
sudo cp $run_directory/bashrc /root/.bashrc
|
|
sudo cp $run_directory/vimrc /root/.vimrc
|
|
sudo cp $run_directory/tmux.conf /root/.tmux.conf
|
|
fi
|
|
|
|
else
|
|
echo "Copying rcs to root directory..."
|
|
cp $run_directory/bashrc /root/.bashrc
|
|
cp $run_directory/vimrc /root/.vimrc
|
|
cp $run_directory/tmux.conf /root/.tmux.conf
|
|
fi
|
|
|
|
echo "Finished install. Exiting..."
|
|
exit 0
|