Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F995899
replace.sh
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
replace.sh
View Options
#!/bin/bash
# HOW TO USE:
# chmod +x replace.sh
# app_port=9080 project_name=testing mongo_external_port=9990 nginx_http_port=1123 nginx_https_port=1590 ./replace.sh
function
is_not_empty
{
if
[[
-z
"
$1
"
]]
then
echo
"Argument missing!"
exit
1
fi
}
is_not_empty
$app_port
is_not_empty
$project_name
is_not_empty
$mongo_external_port
is_not_empty
$nginx_http_port
is_not_empty
$nginx_https_port
if
[[
"
$OSTYPE
"
==
"darwin"
*
]]
;
then
sed
=
gsed
else
sed
=
sed
fi
if
[[
-x
"
$(
command
-v
$sed
)
"
]]
;
then
$sed
-i
"s/<<app_port>>/
$app_port
/g"
app.dockerfile
docker-compose.yml
sealious.yml
vhost.conf
src/backend/collections/users.test.js
config.js
manifest.js
$sed
-i
"s/<<project_name>>/
$project_name
/g"
app.dockerfile
docker-compose.yml
package.json
src/frontend/index.html
src/frontend/components/Main/Main.jsx
manifest.js
$sed
-i
"s/<<mongo_external_port>>/
$mongo_external_port
/g"
docker-compose.yml
$sed
-i
"s/<<nginx_http_port>>/
$nginx_http_port
/g"
docker-compose.yml
vhost.conf
$sed
-i
"s/<<nginx_https_port>>/
$nginx_https_port
/g"
docker-compose.yml
vhost.conf
else
echo
Please
install
gnu-sed
on
your
device
and
try
again
fi
rm
replace.sh
File Metadata
Details
Attached
Mime Type
text/x-shellscript
Expires
Tue, Dec 24, 01:17 (22 h, 6 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
556992
Default Alt Text
replace.sh (1 KB)
Attached To
Mode
rST sealious-template
Attached
Detach File
Event Timeline
Log In to Comment