Browse Source

Remove old daemon commands

Bob Mottram 7 years ago
parent
commit
1163ffd146

+ 2
- 2
src/freedombone-app-sip View File

@@ -146,7 +146,7 @@ function restore_local_sip {
146 146
             exit 3679
147 147
         fi
148 148
         rm -rf $temp_restore_dir
149
-        service sipwitch restart
149
+        systemctl restart sipwitch
150 150
         echo $"Restore of SIP settings complete"
151 151
     fi
152 152
 }
@@ -212,7 +212,7 @@ function update_sipwitch_daemon {
212 212
         return
213 213
     fi
214 214
 
215
-    service sipwitch stop
215
+    systemctl stop sipwitch
216 216
 
217 217
     # remove the original sipwitch daemon if it exists
218 218
     if [ -f /etc/init.d/sipwitch ]; then

+ 2
- 2
src/freedombone-app-xmpp View File

@@ -447,7 +447,7 @@ function restore_local_xmpp {
447 447
             exit 725
448 448
         fi
449 449
         rm -rf $temp_restore_dir
450
-        service prosody restart
450
+        systemctl restart prosody
451 451
         chown -R prosody:prosody /var/lib/prosody/*
452 452
         echo $"Restore of xmpp settings complete"
453 453
     fi
@@ -472,7 +472,7 @@ function restore_remote_xmpp {
472 472
             exit 725
473 473
         fi
474 474
         rm -rf $temp_restore_dir
475
-        service prosody restart
475
+        systemctl restart prosody
476 476
         chown -R prosody:prosody /var/lib/prosody/*
477 477
         echo $"Restore of xmpp settings complete"
478 478
     fi

+ 2
- 2
src/freedombone-backup-remote View File

@@ -92,7 +92,7 @@ function suspend_site {
92 92
     fi
93 93
     SUSPENDED_SITE="$1"
94 94
     nginx_dissite $SUSPENDED_SITE
95
-    service nginx reload
95
+    systemctl reload nginx
96 96
 }
97 97
 
98 98
 function restart_site {
@@ -101,7 +101,7 @@ function restart_site {
101 101
         return
102 102
     fi
103 103
     nginx_ensite $SUSPENDED_SITE
104
-    service nginx reload
104
+    systemctl reload nginx
105 105
     SUSPENDED_SITE=
106 106
 }
107 107
 

+ 13
- 20
src/freedombone-mesh View File

@@ -121,29 +121,22 @@ function install_toxcore {
121 121
     sudo cp /tmp/tox-bootstrapd.conf /etc/tox-bootstrapd.conf
122 122
     rm /tmp/tox-bootstrapd.conf
123 123
 
124
-    if [ -f /bin/systemctl ]; then
125
-        if [ ! -f ~/develop/toxcore/other/bootstrap_daemon/tox-bootstrapd.service ]; then
126
-            echo $"File not found ~/develop/toxcore/other/bootstrap_daemon/tox-bootstrapd.service"
127
-            exit 7359
128
-        fi
129
-        sudo cp ~/develop/toxcore/other/bootstrap_daemon/tox-bootstrapd.service /etc/systemd/system/
130
-
131
-        sudo systemctl daemon-reload
132
-        sudo systemctl enable tox-bootstrapd.service
133
-        sudo systemctl start tox-bootstrapd.service
134
-        if [ ! "$?" = "0" ]; then
135
-            sudo systemctl status tox-bootstrapd.service
136
-            exit 5846
137
-        fi
124
+    if [ ! -f ~/develop/toxcore/other/bootstrap_daemon/tox-bootstrapd.service ]; then
125
+        echo $"File not found ~/develop/toxcore/other/bootstrap_daemon/tox-bootstrapd.service"
126
+        exit 7359
127
+    fi
128
+    sudo cp ~/develop/toxcore/other/bootstrap_daemon/tox-bootstrapd.service /etc/systemd/system/
138 129
 
139
-        sudo systemctl restart tox-bootstrapd.service
140
-    else
141
-        sudo cp ~/develop/toxcore/other/bootstrap_daemon/tox-bootstrapd.sh /etc/init.d/tox-bootstrapd
142
-        sudo chmod 755 /etc/init.d/tox-bootstrapd
143
-        sudo update-rc.d tox-bootstrapd defaults
144
-        sudo service tox-bootstrapd start
130
+    sudo systemctl daemon-reload
131
+    sudo systemctl enable tox-bootstrapd.service
132
+    sudo systemctl start tox-bootstrapd.service
133
+    if [ ! "$?" = "0" ]; then
134
+        sudo systemctl status tox-bootstrapd.service
135
+        exit 5846
145 136
     fi
146 137
 
138
+    sudo systemctl restart tox-bootstrapd.service
139
+
147 140
     TOX_PUBLIC_KEY=$(cat /var/log/syslog | grep tox | grep "Public Key" | awk -F ' ' '{print $8}' | tail -1)
148 141
     if [ ${#TOX_PUBLIC_KEY} -lt 30 ]; then
149 142
         echo $'Could not obtain the tox node public key'

+ 1
- 1
src/freedombone-renew-cert View File

@@ -135,7 +135,7 @@ function renew_startssl {
135 135
         sed -i "s|$HOSTNAME.crt|$HOSTNAME.bundle.crt|g" /etc/nginx/sites-available/$HOSTNAME
136 136
 
137 137
         echo $'Certificate installed'
138
-        service nginx restart
138
+        systemctl restart nginx
139 139
         return
140 140
     fi
141 141
 

+ 1
- 1
src/freedombone-restore-local View File

@@ -205,7 +205,7 @@ function restore_mariadb {
205 205
                 exit 962
206 206
             fi
207 207
             echo $"Restarting database"
208
-            service mysql restart
208
+            systemctl restart mysql
209 209
             echo $"Change the MariaDB password to the backup version"
210 210
             DATABASE_PASSWORD="$db_pass"
211 211
             ${PROJECT_NAME}-pass -u root -a mariadb -p "$DATABASE_PASSWORD"

+ 1
- 1
src/freedombone-restore-remote View File

@@ -198,7 +198,7 @@ function restore_mariadb {
198 198
                 exit 962
199 199
             fi
200 200
             echo $"Restarting database"
201
-            service mysql restart
201
+            systemctl restart mysql
202 202
             echo $"Change the MariaDB password to the backup version"
203 203
             DATABASE_PASSWORD="$db_pass"
204 204
             ${PROJECT_NAME}-pass -u root -a mariadb -p "$DATABASE_PASSWORD"

+ 2
- 2
src/freedombone-utils-backup View File

@@ -35,7 +35,7 @@ function suspend_site {
35 35
     # suspends a given website
36 36
     SUSPENDED_SITE="$1"
37 37
     nginx_dissite $SUSPENDED_SITE
38
-    service nginx reload
38
+    systemctl reload nginx
39 39
 }
40 40
 
41 41
 function restart_site {
@@ -44,7 +44,7 @@ function restart_site {
44 44
         return
45 45
     fi
46 46
     nginx_ensite $SUSPENDED_SITE
47
-    service nginx reload
47
+    systemctl reload nginx
48 48
     SUSPENDED_SITE=
49 49
 }
50 50