Fixed installer, so propertly detects service platform type
Bryan Roe committed
Aug 13, 2019 at 15:22 UTC
857fdb9bb447357e27841ec90b4dd97be4edaa8d
1 file changed
+4
-3
agents/meshinstall-linux.sh
+4
-3
@@ -13,12 +13,13 @@ CheckStartupType() {
13
fi
14
15
# echo "Checking process autostart system..."
16
- starttype=`ps -p 1 -o command= | awk '{ a=split($0, res, "/"); split(res[a], f, " "); print f[1]}'`
16
+ starttype1=`cat /proc/1/status | grep 'Name:' | awk '{ print $2; }'`
17
+ starttype2=`ps -p 1 -o command= | awk '{a=split($0,res," "); b=split(res[a],tp,"/"); print tp[b]; }'`
18
19
# Systemd
19
- if [[ $starttype == 'systemd' ]]
20
+ if [[ $starttype1 == 'systemd' ]]
21
then return 1;
21
- elif [[ $starttype == 'init' ]]
22
+ elif [[ $starttype1 == 'init' || $starttype2 == 'init' ]]
23
then
24
if [ -d "/etc/init" ]
25
then