write config files

This commit is contained in:
mollusk 2018-02-05 19:50:24 -07:00
parent b4a327876f
commit d0d44c92e4
2 changed files with 33 additions and 4 deletions

View File

@ -1,2 +1 @@
FIRSTRUN="true"
DEFAULTREPO=""

View File

@ -13,9 +13,21 @@ PURPLE="\033[0;35m"
LPURPLE="\033[1;35m"
BWHITE="\e[1m"
NC='\033[0m' # No Color
source config.sh
passwordRepo="http://gitbutter.pw/mollusk/vault.git"
function writeConfig(){
cat >config.sh <<EOL
FIRSTRUN="${1}"
EOL
return
}
function readConfig(){
echo ${FIRSTRUN}
}
function installGit(){
if [ ! -f /usr/bin/git ];then
@ -23,6 +35,8 @@ function installGit(){
fi
}
function gitSetup(){
printf "${LCYAN} ===============${NC}\n"
@ -82,13 +96,29 @@ function gitButterSync(){
printf "${LBLUE}Where do you want to save your repository?(default: ${defaultRepoDir}) "
printf "\n\n${LPURPLE}INFO: Cloning your repository...${NC}\n"
git clone ${domain}/${gbusername}/${gbrepo} ${defaultRepoDir}
}
function main(){
while true;do
if [ "${FIRSTRUN}" = "true" ];then
installGit
#gitSetup
gitButterSync
if [ -d ${defaultRepoDir}/${gbrepo} ];then
writeConfig "false"
continue
fi
echo "Hello, welcome to gkmanager"
echo -n "Chose an option: "
read option
fi
done
}
main