2022-04-01 00:48:57 +08:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2024-04-07 08:08:00 +08:00
|
|
|
# Stopping services
|
2022-04-01 00:48:57 +08:00
|
|
|
sudo systemctl stop bbb-html5 mongod
|
|
|
|
|
|
|
|
cd "$(dirname "$0")"
|
|
|
|
|
2024-04-07 08:08:00 +08:00
|
|
|
# Handling arguments
|
|
|
|
for var in "$@"; do
|
|
|
|
if [[ $var == --reset ]]; then
|
|
|
|
echo "Performing Meteor reset..."
|
2022-04-01 00:48:57 +08:00
|
|
|
rm -rf node_modules
|
2024-04-07 08:08:00 +08:00
|
|
|
meteor reset
|
2022-04-01 00:48:57 +08:00
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2024-04-07 08:08:00 +08:00
|
|
|
# Installing dependencies if node_modules is not present
|
|
|
|
if [ ! -d ./node_modules ]; then
|
|
|
|
meteor npm i
|
2022-04-01 20:15:30 +08:00
|
|
|
fi
|
|
|
|
|
2024-04-07 08:08:00 +08:00
|
|
|
# Run meteor in the foreground to keep the script running
|
|
|
|
npm start
|
|
|
|
|
|
|
|
# If npm start exits, the script reaches this point and exits, triggering the cleanup trap
|