-
Notifications
You must be signed in to change notification settings - Fork 0
/
option.sh
82 lines (66 loc) · 2.18 KB
/
option.sh
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
#!/bin/bash
##
# @Description: This script is produce to make changing of client url easy as ABC
# Author: Odejinmi Samuel ~ Samji
##
function show_usage (){
printf "Usage: changeclient.sh -c html5client -n rommy\n"
printf "\n"
printf "Options:\n"
printf " -c|--current, The current client url\n"
printf " -n|--new , The new client url you want\n"
printf " -h|--help, Print help\n"
return 0
}
while [ ! -z "$1" ]; do
case "$1" in
--current|-c)
shift
OLDNAME=$1
echo "You entered current as: $1"
;;
--new|-n)
shift
NEWNAME=$1
echo "You entered new as: $1"
;;
--help|-h)
shift
echo "You requested for help"
show_usage
;;
*)
show_usage
;;
esac
shift
done
if [ "$OLDNAME" == "" ]; then
echo "You must specify a valid old name (like the name given in the docs)."
show_usage
return
fi
if [ "$NEWNAME" == "" ]; then
err "You must specify a valid new name (the name you want your meeting like to change to)."
show_usage
return
fi
##Change the default path for HTML5 client
echo " -Changing ${OLDNAME} in the config settings to ${newname}"
TARGET=/usr/share/meteor/bundle/programs/server/assets/app/config/settings.yml
yq w -i $TARGET public.app.basename ${NEWNAME}
echo " - changing ${OLDNAME} in nginx to ${NEWNAME}"
TARGET=/etc/bigbluebutton/nginx/bbb-html5.nginx
sed -i "s|$OLDNAME|$NEWNAME|g" $TARGET
echo " - changing ${OLDNAME} to ${NEWNAME} in bigbluebutton properties"
TARGET=/usr/share/bbb-web/WEB-INF/classes/bigbluebutton.properties
sed -i "s|$OLDNAME|$NEWNAME|g" $TARGET
echo " - changing ${OLDNAME} to ${NEWNAME} in system start"
TARGET=/usr/share/meteor/bundle/systemd_start.sh
sed -i "s|$OLDNAME|$NEWNAME|g" $TARGET
echo " - changing ${OLDNAME} to ${NEWNAME} in frontend"
TARGET=/usr/share/meteor/bundle/systemd_start_frontend.sh
sed -i "s|$OLDNAME|$NEWNAME|g" $TARGET
sudo service nginx reload && sudo bbb-conf --restart
echo "*************Thanks for using me************"
echo "Give SamjiDiamond a star on github"