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"
|
LPURPLE="\033[1;35m"
|
||||||
BWHITE="\e[1m"
|
BWHITE="\e[1m"
|
||||||
NC='\033[0m' # No Color
|
NC='\033[0m' # No Color
|
||||||
|
source config.sh
|
||||||
|
|
||||||
passwordRepo="http://gitbutter.pw/mollusk/vault.git"
|
passwordRepo="http://gitbutter.pw/mollusk/vault.git"
|
||||||
|
|
||||||
|
|
||||||
|
function writeConfig(){
|
||||||
|
cat >config.sh <<EOL
|
||||||
|
FIRSTRUN="${1}"
|
||||||
|
EOL
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
function readConfig(){
|
||||||
|
echo ${FIRSTRUN}
|
||||||
|
}
|
||||||
function installGit(){
|
function installGit(){
|
||||||
|
|
||||||
if [ ! -f /usr/bin/git ];then
|
if [ ! -f /usr/bin/git ];then
|
||||||
@ -23,6 +35,8 @@ function installGit(){
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function gitSetup(){
|
function gitSetup(){
|
||||||
|
|
||||||
printf "${LCYAN} ===============${NC}\n"
|
printf "${LCYAN} ===============${NC}\n"
|
||||||
@ -82,13 +96,29 @@ function gitButterSync(){
|
|||||||
printf "${LBLUE}Where do you want to save your repository?(default: ${defaultRepoDir}) "
|
printf "${LBLUE}Where do you want to save your repository?(default: ${defaultRepoDir}) "
|
||||||
|
|
||||||
printf "\n\n${LPURPLE}INFO: Cloning your repository...${NC}\n"
|
printf "\n\n${LPURPLE}INFO: Cloning your repository...${NC}\n"
|
||||||
|
|
||||||
|
git clone ${domain}/${gbusername}/${gbrepo} ${defaultRepoDir}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function main(){
|
function main(){
|
||||||
installGit
|
while true;do
|
||||||
#gitSetup
|
if [ "${FIRSTRUN}" = "true" ];then
|
||||||
gitButterSync
|
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
|
main
|
Loading…
x
Reference in New Issue
Block a user