mirror of
https://github.com/Unitech/pm2.git
synced 2025-12-08 20:35:53 +00:00
22 lines
468 B
Bash
22 lines
468 B
Bash
#!/usr/bin/env bash
|
|
|
|
if [ "$EUID" -ne 0 ]
|
|
then
|
|
echo "Please run as root"
|
|
exit
|
|
fi
|
|
|
|
SRC=$(cd $(dirname "$0"); pwd)
|
|
source "${SRC}/include.sh"
|
|
|
|
cd $file_path
|
|
|
|
$pm2 startup upstart -u $USER --hp $HOME
|
|
spec "should startup command generation exited succesfully"
|
|
test -e /etc/init.d/pm2-$USER
|
|
spec "should have generated upstart file"
|
|
$pm2 unstartup upstart
|
|
spec "should have disabled startup"
|
|
! test -e /etc/init.d/pm2-$USER
|
|
spec "should have deleted upstart file"
|