|
@@ -1,6 +1,6 @@
|
|
#!/bin/bash
|
|
#!/bin/bash
|
|
|
|
|
|
-#Read parameters
|
|
|
|
|
|
+# Read parameters
|
|
echo "Please input the configuration file name"
|
|
echo "Please input the configuration file name"
|
|
read conf
|
|
read conf
|
|
echo "Please input the program"
|
|
echo "Please input the program"
|
|
@@ -14,25 +14,24 @@ read command
|
|
echo "Please input the directory"
|
|
echo "Please input the directory"
|
|
read directory
|
|
read directory
|
|
|
|
|
|
-#Copy the configuration file in the supervisor.d folder
|
|
|
|
|
|
+# Copy the configuration file in the supervisor.d folder
|
|
served="/etc/supervisord.d"
|
|
served="/etc/supervisord.d"
|
|
if [ -f "$served/$conf" ]
|
|
if [ -f "$served/$conf" ]
|
|
then
|
|
then
|
|
- echo "The service has already existed"
|
|
|
|
- exit 1
|
|
|
|
|
|
+ echo "The service has already existed"
|
|
|
|
+ exit 1
|
|
else
|
|
else
|
|
# The first position is server.conf File installation directory
|
|
# The first position is server.conf File installation directory
|
|
- cp server.conf $served/$conf
|
|
|
|
|
|
+ cp server.conf $served/$conf
|
|
fi
|
|
fi
|
|
|
|
|
|
-#替换变量
|
|
|
|
-
|
|
|
|
|
|
+# Variable substitution
|
|
sed -i "s#PROGRAM#$program#g" $served/$conf
|
|
sed -i "s#PROGRAM#$program#g" $served/$conf
|
|
sed -i "s#PROCESS_NAME#$process_name#g" $served/$conf
|
|
sed -i "s#PROCESS_NAME#$process_name#g" $served/$conf
|
|
sed -i "s#USER#$user#g" $served/$conf
|
|
sed -i "s#USER#$user#g" $served/$conf
|
|
sed -i "s#DIRECTORY#$directory#g" $served/$conf
|
|
sed -i "s#DIRECTORY#$directory#g" $served/$conf
|
|
sed -i "s#COMMAND#$command#g" $served/$conf
|
|
sed -i "s#COMMAND#$command#g" $served/$conf
|
|
|
|
|
|
-#重读supervisor配置文件
|
|
|
|
|
|
+# Reread supervisor's configuration file
|
|
supervisorctl update
|
|
supervisorctl update
|
|
|
|
|