Tweak setup.sh

This commit is contained in:
2020-02-21 17:31:14 +00:00
parent 997af377de
commit 6eb35fff4d
2 changed files with 43 additions and 7 deletions

33
setup.sh Normal file → Executable file
View File

@@ -1,13 +1,32 @@
#!/bin/bash
CYAN='\033[0;36m'
NC='\033[0m'
echo "${CYAN}andrejusk/dotfiles${NC}"
dir=`dirname "$0"`
source "$dir/colors.sh"
printf "${C_CYAN}andrejusk/dotfiles${C_NC}\n"
# Check if running
lock_file="$dir/setup.lock"
if [ -f "$dir/.lock" ]; then
printf "${C_RED}Script already running${C_NC}\n"
exit 1
elif
touch
fi
# Check for root
if [[ $EUID -ne 0 ]]; then
echo "sudo !!"
printf "${C_RED}Called without sudo, please run:${C_NC}\n"
printf "sudo !!\n\n"
exit 1
fi
install_dir="$0/install"
state_dir="$install_dir/.state"
for script in $install_dir/*.sh; do sh $script; done
# Run all install scripts
install_dir="$dir/install"
for script in $install_dir/*.sh;
do
if [ -f "$script.lock" ]; then
printf "$script\n"
fi
printf $script
# sh $script;
done