remove service install
This commit is contained in:
parent
732f77a0b7
commit
006253dcbb
2 changed files with 2 additions and 24 deletions
9
cli
9
cli
|
|
@ -14,26 +14,21 @@ cat logo.txt
|
|||
|
||||
_LATEST=$(npm view npr-one version)
|
||||
_CURRENT=$(node version.js)
|
||||
_TEMPLATE='pm2.service'
|
||||
_SERVICE='/etc/systemd/system/pm2.service'
|
||||
_RELEASE='/etc/os-release'
|
||||
|
||||
if [ -f $_RELEASE ]; then
|
||||
|
||||
source $_RELEASE
|
||||
|
||||
if [ ID == 'rasbian' ] && [ ! -f $_SERVICE ]; then
|
||||
if [ $ID == 'raspbian' ]; then
|
||||
sudo chown -R $(whoami) $(npm config get prefix)/{lib/node_modules,bin,share}
|
||||
sudo cp $_TEMPLATE $_SERVICE
|
||||
sudo systemctl enable $_SERVICE
|
||||
sudo systemctl start $_SERVICE
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
if [ $_CURRENT != $_LATEST ]; then
|
||||
echo "updating..."
|
||||
npm install -g npr-one &> /dev/null
|
||||
npm install -g npr-one
|
||||
fi
|
||||
|
||||
node index.js
|
||||
|
|
|
|||
17
pm2.service
17
pm2.service
|
|
@ -1,17 +0,0 @@
|
|||
[Unit]
|
||||
Description=PM2 next gen process manager for Node.js
|
||||
After=network.target remote-fs.target
|
||||
|
||||
[Service]
|
||||
Type=forking
|
||||
User=pi
|
||||
|
||||
ExecStart=/usr/local/lib/node_modules/pm2/bin/pm2 resurrect
|
||||
ExecReload=/usr/local/lib/node_modules/pm2/bin/pm2 reload all
|
||||
|
||||
ExecStop=/usr/local/lib/node_modules/pm2/bin/pm2 dump
|
||||
ExecStop=/usr/local/lib/node_modules/pm2/bin/pm2 delete all
|
||||
ExecStop=/usr/local/lib/node_modules/pm2/bin/pm2 kill
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Loading…
Reference in a new issue