This repository has been archived by the owner on Jun 27, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Linux distros may change the name of nodejs binary file,it was found two names: " node" or "nodejs". The script has to identify which name of the nodejs binary is being used before continuing. Also, depending on the distro sh files may change and it is more secure to use /bin/bash than /bin/sh. For compatibility purposes Signed-off-by: Bruno Bottazzini <[email protected]>
- Loading branch information
Bruno Bottazzini
committed
Aug 25, 2015
1 parent
d39ded3
commit 38ec20b
Showing
3 changed files
with
21 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/bin/sh | ||
#!/bin/bash | ||
|
||
# This file is part of the Soletta Project | ||
# | ||
|
@@ -35,6 +35,8 @@ print_need_dep () { | |
} | ||
|
||
RETVAL=0 | ||
SYSTEMD_SERVICE_PATH="/etc/systemd/system" | ||
|
||
test_dep () { | ||
SILENT=$2 | ||
PKG_NAME=$3 | ||
|
@@ -65,6 +67,9 @@ fi | |
test_dep "node" 1 | ||
if [ $RETVAL -eq 1 ]; then | ||
test_dep "nodejs" 0 "nodejs" | ||
NODE_BIN_NAME="nodejs" | ||
else | ||
NODE_BIN_NAME="node" | ||
fi | ||
|
||
test_dep "sol-fbp-runner" 1 | ||
|
@@ -78,20 +83,29 @@ test_dep "dot" 0 "graphviz" | |
|
||
test_dep "npm" 0 "npm" | ||
|
||
test_dep "bower" 1 | ||
test_dep "bower" 1 2>/dev/null | ||
if [ $RETVAL -eq 1 ]; then | ||
print_need_dep "bower" | ||
echo "sudo npm install -g bower" | ||
exit 1 | ||
else | ||
BOWER=$(bower -v) | ||
if [ -z "$BOWER" ]; then | ||
echo "If you are running distro debian based machine run:" | ||
echo "sudo apt-get install nodejs-legacy" | ||
exit 1 | ||
fi | ||
fi | ||
|
||
npm install | ||
bower install | ||
|
||
echo "Installing required services..." | ||
SERVER_PATH=$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd) | ||
su -c "cp $SERVER_PATH/scripts/units/[email protected] /lib/systemd/system/" | ||
su -c "cp $SERVER_PATH/scripts/units/soletta-dev-app-server.service.in /lib/systemd/system/soletta-dev-app-server.service" | ||
su -c "sed -i "s@PATH@"$SERVER_PATH"@" /lib/systemd/system/soletta-dev-app-server.service" | ||
su -c "cp $SERVER_PATH/scripts/units/[email protected] $SYSTEMD_SERVICE_PATH/ && | ||
cp $SERVER_PATH/scripts/units/soletta-dev-app-server.service.in $SYSTEMD_SERVICE_PATH/soletta-dev-app-server.service && | ||
sed -i "s@PATH@"$SERVER_PATH"@" $SYSTEMD_SERVICE_PATH/soletta-dev-app-server.service && | ||
sed -i "s@"NODE_BIN_NAME"@"$NODE_BIN_NAME"@" $SYSTEMD_SERVICE_PATH/soletta-dev-app-server.service" | ||
systemctl daemon-reload | ||
echo "to start server run:" | ||
echo "systemctl start soletta-dev-app-server" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/bin/sh | ||
#!/bin/bash | ||
|
||
# This file is part of the Soletta Project | ||
# | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters