Files
linux-toolkit/scripts/setup.sh

58 lines
1.2 KiB
Bash
Executable File

#!/bin/bash
set -e
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
TOOLKIT_DIR="$SCRIPT_DIR"/..
# Load package manager script
. "$SCRIPT_DIR"/util/pkg-mgr.sh
# Load color script
. "$SCRIPT_DIR"/util/color.sh
update_user_shell() {
/usr/sbin/usermod -s /usr/bin/zsh "$1"
}
install_user_config() {
/usr/bin/ln -s /etc/toolkit/sh/"$1" "$2"
}
print_info Installing necessary packages...
install_package zsh
print_info Setting up user shells...
update_user_shell root
update_user_shell coby
install_user_config .zshrc /root/.
install_user_config .zshrc /home/coby/.
install_user_config .vimrc /root/.
install_user_config .vimrc /home/coby/.
# Replace old ssh server config
if [[ -d /etc/ssh ]]; then
ln -sf "$TOOLKIT_DIR"/ssh/sshd_config /etc/ssh/.
elif
print_warn /etc/ssh does not exist, failed to install sshd config
fi
# Install cronjobs
if [[ -d /etc/cron.d ]]; then
ln -sf "$TOOLKIT_DIR"/cron/* /etc/cron.d/.
elif
print_warn /etc/cron.d does not exist, failed to install cronjobs
print_warn Are you running a debian-based distro?
fi
print_info Installing necessary submodules...
# Pull submodules
git submodule update --init --recursive
print_info Setup complete