forked from switnet/quick-jibri-installer
				
			Compare commits
	
		
			No commits in common. "2da6a817e8441fd345239bbcc2f8ea5a6f626fe4" and "3a35cfa1b4352c24ba45a40f0f21298b0a0b895d" have entirely different histories.
		
	
	
		
			2da6a817e8
			...
			3a35cfa1b4
		
	
		|  | @ -26,31 +26,6 @@ printwc "${Blue}" "\n#--------------------------------------------------" | ||||||
| printwc "${Blue}" "\n# $1" | printwc "${Blue}" "\n# $1" | ||||||
| printwc "${Blue}" "\n#--------------------------------------------------\n" | printwc "${Blue}" "\n#--------------------------------------------------\n" | ||||||
| } | } | ||||||
| restart_jibri() { |  | ||||||
| if [ "$(dpkg-query -W -f='${Status}' "jibri" 2>/dev/null | grep -c "ok installed")" == "1" ] |  | ||||||
| then |  | ||||||
|     systemctl restart jibri |  | ||||||
|     systemctl restart jibri-icewm |  | ||||||
|     systemctl restart jibri-xorg |  | ||||||
| else |  | ||||||
|     echo "Jibri service not installed" |  | ||||||
| fi |  | ||||||
| } |  | ||||||
| restart_services() { |  | ||||||
|     systemctl restart jitsi-videobridge2 |  | ||||||
|     systemctl restart jicofo |  | ||||||
|     restart_jibri |  | ||||||
|     systemctl restart prosody |  | ||||||
| } |  | ||||||
| test_match() { |  | ||||||
| if grep -q "$1" "$2" ; then |  | ||||||
|     echo "$(basename "$2") - OK..." |  | ||||||
| else |  | ||||||
|     echo "$(basename "$2"), FAIL..." |  | ||||||
|     echo "Please report this to https://forge.switnet.net/switnet/quick-jibri-installer" |  | ||||||
|     exit |  | ||||||
| fi |  | ||||||
| } |  | ||||||
| 
 | 
 | ||||||
| while getopts m: option | while getopts m: option | ||||||
| do | do | ||||||
|  | @ -86,12 +61,23 @@ WS_MATCH1='# ensure all static content can always be found first' | ||||||
| PROS_MATCH1='"av_moderation";' | PROS_MATCH1='"av_moderation";' | ||||||
| PROS_MATCH2='breakout_rooms_muc = "breakout.' | PROS_MATCH2='breakout_rooms_muc = "breakout.' | ||||||
| PROS_MATCH3='VirtualHost "recorder.' | PROS_MATCH3='VirtualHost "recorder.' | ||||||
| CONFIG_MATCH1='List of undocumented settings used in jitsi-meet' | CONFIG_MATCH1='Settings for the GIPHY integration' | ||||||
| EXCALIDRAW_HOME="/opt/excalidraw" | EXCALIDRAW_HOME="/opt/excalidraw" | ||||||
| EXCAL_MATCH1="prometheus.metrics(io" | EXCAL_MATCH1="prometheus.metrics(io" | ||||||
| EXCAL_NEW_PORT="9091" | EXCAL_NEW_PORT="9091" | ||||||
| EXCAL_PORT_FILE="$EXCALIDRAW_HOME/backend/src/index.ts" | EXCAL_PORT_FILE="$EXCALIDRAW_HOME/backend/src/index.ts" | ||||||
| 
 | 
 | ||||||
|  | 
 | ||||||
|  | # Test for matches | ||||||
|  | test_match() { | ||||||
|  | if grep -q "$1" "$2" ; then | ||||||
|  |     echo "$(basename "$2") - OK..." | ||||||
|  | else | ||||||
|  |     echo "$(basename "$2"), FAIL..." | ||||||
|  |     echo "Please report this to https://forge.switnet.net/switnet/quick-jibri-installer" | ||||||
|  |     exit | ||||||
|  | fi | ||||||
|  | } | ||||||
| # Make sure we can rely on the match strings. | # Make sure we can rely on the match strings. | ||||||
| printf "Testing match strings on config files.\n" | printf "Testing match strings on config files.\n" | ||||||
| test_match "$WS_MATCH1" "$WS_CONF" | test_match "$WS_MATCH1" "$WS_CONF" | ||||||
|  | @ -114,14 +100,14 @@ sudo -u excalidraw cp .env.development .env.production | ||||||
| 
 | 
 | ||||||
| # Use documented port to get some sort of standarization. | # Use documented port to get some sort of standarization. | ||||||
| if sed -n "/$EXCAL_MATCH1/,/});/p" "$EXCAL_PORT_FILE" |grep -q port: ; then | if sed -n "/$EXCAL_MATCH1/,/});/p" "$EXCAL_PORT_FILE" |grep -q port: ; then | ||||||
|     echo -e "> Update predefined port for metrics to $EXCAL_NEW_PORT\n" |     echo "> Update predefined port for metrics to $EXCAL_NEW_PORT\n" | ||||||
|     sed -i "/$EXCAL_MATCH1/,/});/s|port:.*,|port: $EXCAL_NEW_PORT,|" "$EXCAL_PORT_FILE" |     sed -i "/$EXCAL_MATCH1/,/});/s|port:.*,|port: $EXCAL_NEW_PORT,|" "$EXCAL_PORT_FILE" | ||||||
| else | else | ||||||
|     echo -e "> Define new port from default to $EXCAL_NEW_PORT\n" |     echo "> Define new port from default to $EXCAL_NEW_PORT\n" | ||||||
|     sed -i  "/$EXCAL_MATCH1/a \ \ \ \ port: $EXCAL_NEW_PORT," "$EXCAL_PORT_FILE" |     sed -i  "/$EXCAL_MATCH1/a \ \ \ \ port: $EXCAL_NEW_PORT," "$EXCAL_PORT_FILE" | ||||||
| fi | fi | ||||||
| 
 | 
 | ||||||
| printf "Installing npm backend.\n" | printf "\nInstalling npm backend.\n" | ||||||
| sudo -u excalidraw npm install | sudo -u excalidraw npm install | ||||||
| sudo -u excalidraw npm run build | sudo -u excalidraw npm run build | ||||||
| 
 | 
 | ||||||
|  | @ -156,7 +142,7 @@ else | ||||||
|     sed -i "/$PROS_MATCH3/i \\\n" "$PROSODY_FILE" |     sed -i "/$PROS_MATCH3/i \\\n" "$PROSODY_FILE" | ||||||
| fi | fi | ||||||
| 
 | 
 | ||||||
| printf "\n# Checking for whitebord setup at %s.\n" "$(basename "$MEET_CONF")" | printf "\n# Checking for whitebord setup at $(basename "$MEET_CONF").\n" | ||||||
| if [ -z "$(sed -n '/whiteboard: {/,/},/p' "$MEET_CONF")" ]; then | if [ -z "$(sed -n '/whiteboard: {/,/},/p' "$MEET_CONF")" ]; then | ||||||
|     echo "> No present configuration on current config.js file" |     echo "> No present configuration on current config.js file" | ||||||
|     sed -i "/$CONFIG_MATCH1/i \\\n" "$MEET_CONF" |     sed -i "/$CONFIG_MATCH1/i \\\n" "$MEET_CONF" | ||||||
|  | @ -205,4 +191,3 @@ systemctl enable excalidraw.service | ||||||
| systemctl start excalidraw.service | systemctl start excalidraw.service | ||||||
| 
 | 
 | ||||||
| printwc "${Green}" "\nExcalidraw setup complete!\n" | printwc "${Green}" "\nExcalidraw setup complete!\n" | ||||||
| restart_services |  | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue