Repository navigation
Expand file tree
/
Copy pathbbs.sh
More file actions
executable file
·155 lines (129 loc) · 2.79 KB
/
Copy pathbbs.sh
File metadata and controls
executable file
·155 lines (129 loc) · 2.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
#!/bin/bash
#tmp="/tmp/bbstmp-$$";
#BBS_TITLE="git bbs";
source ./bbs.conf
COLOR_RED="\e[31m";
COLOR_GREEN="\e[32m";
COLOR_BLUE="\e[34m";
COLOR_YELLOW="\e[93m";
COLOR_MAGENTA="\e[95m";
COLOR_WHITE="\e[97m"
#COLOR_DEFAULT="\e[39m";
COLOR_DEFAULT=$COLOR_WHITE;
BGCOLOR="\e[40m";
COLOR_TITLE=$COLOR_MAGENTA
COLOR_BANNER=$COLOR_YELLOW
bbs_init(){
echo -e "$BGCOLOR";
echo -e "$COLOR_DEFAULT";
clear;
}
bbs_shell(){
echo "Be careful with your bash prompt!";
echo "at the end of your session type exit";
echo ""
bash
bbs_init;
echo -e "${COLOR_MAGENTA}welcome back to our BBS!${COLOR_DEFAULT}";
echo "";
}
bbs_show_repos(){
./show-repos.sh
}
bbs_show_clone_repos(){
./show-clone-repos.sh
}
bbs_show_projects(){
./show-projects.sh
}
bbs_create_project(){
NEW_REPO_PATH='';
FIN_FLAG="0";
while [ $FIN_FLAG = "0" ] ; do
echo "create repo wizard";
echo "give the repository_path, example path: project.git"
echo ""
#read -p "path: " -e -i $NEW_REPO_PATH NEW_REPO_PATH
read -p "path: " -e NEW_REPO_PATH
echo "-----------------------------------------";
echo "REPO_PATH : $NEW_REPO_PATH"
echo "-----------------------------------------";
RESPONSE=y;
read -p "IS THIS INFORMATION OK? [type y to continue]: " -e -i 'y' RESPONSE
if [[ "$RESPONSE" = 'y' ]]; then
FIN_FLAG="1";
./make-repo.sh $NEW_REPO_PATH;
echo "";
fi
done
}
bbs_help() {
echo "";
echo "----------------------------------------------------";
echo "1: help";
echo "2: show git repos directory path";
echo "3: show clone commands";
echo "4: show git repos directory path from git home";
echo "5: create new project";
echo "6: enter bash shell";
echo "----------------------------------------------------";
echo "";
}
bbs_exit() {
#rm -f "$tmp";
echo -e "\e[49m";
echo -e "\e[39m";
echo "bye bye!";
exit;
}
bbs_welcome_banner() {
if [ -f "bbs-banner.txt" ];then
echo -e "${COLOR_BANNER}";
cat bbs-banner.txt;
echo -e "${COLOR_DEFAULT}";
fi
echo -e "welcome $USER to ${COLOR_TITLE}${BBS_TITLE}!${COLOR_DEFAULT}";
echo "";
echo "";
}
bbs_menu(){
PS3="Enter your choice: "
options=("help" "show-repos" "show-clone-repos" "show-projects" "create-project" "shell" "Quit")
select opt in "${options[@]}"
do
case $opt in
"help")
bbs_help
echo "";
;;
"show-repos")
bbs_show_repos
echo "";
;;
"show-clone-repos")
bbs_show_clone_repos
echo "";
;;
"show-projects")
bbs_show_projects
echo "";
;;
"create-project")
bbs_create_project
echo "";
;;
"shell")
bbs_shell
echo ""
;;
"Quit")
break
;;
*) echo invalid option;;
esac
done
}
bbs_init
bbs_welcome_banner
bbs_menu
bbs_exit