write config files
This commit is contained in:
parent
b4a327876f
commit
d0d44c92e4
36
gkmanager.sh
36
gkmanager.sh
@ -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(){
|
||||
installGit
|
||||
#gitSetup
|
||||
gitButterSync
|
||||
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
|
Loading…
x
Reference in New Issue
Block a user