-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathsetup
More file actions
45 lines (39 loc) · 723 Bytes
/
setup
File metadata and controls
45 lines (39 loc) · 723 Bytes
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
# define some stuff
saveinfo()
{
echo "BOT_TOKEN=\"$2\"" > ./.env
echo "OWNER_ID=\"$1\"" >> ./.env
}
read_secret()
{
stty -echo
trap 'stty echo' EXIT
read "$@"
stty echo
trap - EXIT
echo
}
# get user inputs
printf "Your Discord User Id: "
read userid
printf "Bot Token: "
read_secret token
get_input(){
while true; do
printf "Is this information correct (y/n)? "
read yn
case $yn in
[Yy]* ) return 1;;
[Nn]* ) return 0;;
* ) echo "Incorrect option (y/n)? "; echo;
esac
done
}
#confirm before ending
get_input
if [[ $? == 1 ]];
then
saveinfo "$userid" "$token"; git checkout main; . ./sync
else
exit
fi