1#!/bin/bash 2if [ $# -ne 1 ]; then 3 echo "USAGE: $0 <online|local>" 4 echo " e.g.: $0 online" 5 exit 1 6fi 7MODE=$1 8 9copy_conf_files() { 10 11 cp ./$MODE/h264.Cargo.toml "../library/codec/h264/Cargo.toml" 12 cp ./$MODE/mpegts.Cargo.toml "../library/container/mpegts/Cargo.toml" 13 cp ./$MODE/flv.Cargo.toml "../library/container/flv/Cargo.toml" 14 cp ./$MODE/streamhub.Cargo.toml "../library/streamhub/Cargo.toml" 15 cp ./$MODE/hls.Cargo.toml "../protocol/hls/Cargo.toml" 16 cp ./$MODE/httpflv.Cargo.toml "../protocol/httpflv/Cargo.toml" 17 cp ./$MODE/rtmp.Cargo.toml "../protocol/rtmp/Cargo.toml" 18 cp ./$MODE/rtsp.Cargo.toml "../protocol/rtsp/Cargo.toml" 19 cp ./$MODE/webrtc.Cargo.toml "../protocol/webrtc/Cargo.toml" 20 cp ./$MODE/pprtmp.Cargo.toml "../application/xiu/Cargo.toml" 21 cp ./$MODE/xiu.Cargo.toml "../application/xiu/Cargo.toml" 22} 23 24# do some operations 25if [ "$MODE" = "online" ]; then 26 echo "copy online cargo project files..." 27 copy_conf_files 28elif [ "$MODE" = "local" ]; then 29 echo "copy local cargo project files..." 30 copy_conf_files 31else 32 echo "not supported mode: $MODE, input <online|local>" 33fi