Skip to content
This repository was archived by the owner on Jan 25, 2022. It is now read-only.

Commit e8e73a0

Browse files
author
Daryl Lozupone
committed
Add check to set-web-processvm to verify process sock exists
clases #12
1 parent 18eb21c commit e8e73a0

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

guest/cli/includes/set-web-processvm

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ echo
44
echo "Setting Web Process VM to $1..."
55
echo
66

7-
87
function editfile {
98
sudo sed -i "s/$1/$2/" "$3"
109
}
@@ -17,10 +16,17 @@ function delfile {
1716

1817
conf_file="/etc/nginx/sites-available/default"
1918

20-
editfile "php5.6" "$1" "$conf_file"
21-
delfile "$conf_file"
19+
if [ -f "/var/run/php/$1.sock" ] || [ -f "/var/run/php/$1-fpm.sock" ]; then
20+
editfile "php5.6" "$1" "$conf_file"
21+
delfile "$conf_file"
22+
23+
editfile "php7.0" "$1" "$conf_file"
24+
delfile "$conf_file"
2225

23-
editfile "php7.0" "$1" "$conf_file"
24-
delfile "$conf_file"
26+
sudo service nginx reload
2527

26-
sudo service nginx reload
28+
return 0
29+
else
30+
echo_if_not_quiet "$*" "=The $1 process is not currently running on this machine!"
31+
return 1
32+
fi

0 commit comments

Comments
 (0)