Quellcode durchsuchen

Experimental control scripts

Bob Mottram vor 8 Jahren
Ursprung
Commit
8c20b15f6f

+ 4
- 1
Makefile Datei anzeigen

27
 	cp img/backgrounds/${APP}_*.png ${DESTDIR}${PREFIX}/share
27
 	cp img/backgrounds/${APP}_*.png ${DESTDIR}${PREFIX}/share
28
 	cp img/avatars/* ${DESTDIR}/usr/share/${APP}/avatars
28
 	cp img/avatars/* ${DESTDIR}/usr/share/${APP}/avatars
29
 	cp src/* ${DESTDIR}${PREFIX}/bin
29
 	cp src/* ${DESTDIR}${PREFIX}/bin
30
-	cp src/${APP}-controlpanel ${DESTDIR}${PREFIX}/bin/control
30
+#	cp src/${APP}-controlpanel ${DESTDIR}${PREFIX}/bin/control
31
 	cp src/${APP}-mesh-batman ${DESTDIR}${PREFIX}/bin/batman
31
 	cp src/${APP}-mesh-batman ${DESTDIR}${PREFIX}/bin/batman
32
 	cp src/${APP}-backup-local ${DESTDIR}${PREFIX}/bin/backup
32
 	cp src/${APP}-backup-local ${DESTDIR}${PREFIX}/bin/backup
33
 	cp src/${APP}-backup-local ${DESTDIR}${PREFIX}/bin/backup2friends
33
 	cp src/${APP}-backup-local ${DESTDIR}${PREFIX}/bin/backup2friends
46
 	chown -R root: /usr/share/${APP}
46
 	chown -R root: /usr/share/${APP}
47
 	chmod -R +r /usr/share/${APP}
47
 	chmod -R +r /usr/share/${APP}
48
 #	bash -c "./translate install"
48
 #	bash -c "./translate install"
49
+	/usr/local/bin/${APP}-prepare-scripts
49
 uninstall:
50
 uninstall:
50
 	rm -f ${PREFIX}/share/${APP}_*.png
51
 	rm -f ${PREFIX}/share/${APP}_*.png
51
 	rm -f ${PREFIX}/share/man/man1/backup.1.gz
52
 	rm -f ${PREFIX}/share/man/man1/backup.1.gz
61
 	rm -f ${PREFIX}/bin/restorefromfriend
62
 	rm -f ${PREFIX}/bin/restorefromfriend
62
 	rm -f ${PREFIX}/bin/batman
63
 	rm -f ${PREFIX}/bin/batman
63
 	rm -rf /etc/${APP}
64
 	rm -rf /etc/${APP}
65
+	rm -f ${PREFIX}/bin/control
66
+	rm -f ${PREFIX}/bin/controluser
64
 	bash -c "./translate uninstall"
67
 	bash -c "./translate uninstall"
65
 clean:
68
 clean:
66
 	rm -f \#* \.#* debian/*.substvars debian/*.log src/*~
69
 	rm -f \#* \.#* debian/*.substvars debian/*.log src/*~

+ 2
- 2
src/freedombone-adduser Datei anzeigen

235
 fi
235
 fi
236
 
236
 
237
 # add user menu on ssh login
237
 # add user menu on ssh login
238
-if ! grep -q 'control' /home/$ADD_USERNAME/.bashrc; then
239
-    echo 'control' >> /home/$ADD_USERNAME/.bashrc
238
+if ! grep -q 'controluser' /home/$ADD_USERNAME/.bashrc; then
239
+    echo 'controluser' >> /home/$ADD_USERNAME/.bashrc
240
 fi
240
 fi
241
 
241
 
242
 ${PROJECT_NAME}-pass -u $ADD_USERNAME -a login -p "$NEW_USER_PASSWORD"
242
 ${PROJECT_NAME}-pass -u $ADD_USERNAME -a login -p "$NEW_USER_PASSWORD"

+ 3
- 0
src/freedombone-app-ghost Datei anzeigen

322
 function ghost_create_config {
322
 function ghost_create_config {
323
     ghost_config=/var/www/${GHOST_DOMAIN_NAME}/htdocs/config.js
323
     ghost_config=/var/www/${GHOST_DOMAIN_NAME}/htdocs/config.js
324
 
324
 
325
+    function_check get_mariadb_password
326
+    get_mariadb_password
327
+
325
     echo "var path = require('path')," > $ghost_config
328
     echo "var path = require('path')," > $ghost_config
326
     echo '    config;' >> $ghost_config
329
     echo '    config;' >> $ghost_config
327
     echo '' >> $ghost_config
330
     echo '' >> $ghost_config

+ 11
- 6
src/freedombone-controlpanel Datei anzeigen

33
 export TEXTDOMAIN=${PROJECT_NAME}-controlpanel
33
 export TEXTDOMAIN=${PROJECT_NAME}-controlpanel
34
 export TEXTDOMAINDIR="/usr/share/locale"
34
 export TEXTDOMAINDIR="/usr/share/locale"
35
 
35
 
36
+if [[ $USER != 'root' ]]; then
37
+    # show the user version of the control panel
38
+    #${PROJECT_NAME}-controlpanel-user
39
+    controluser
40
+    exit 0
41
+fi
42
+
36
 function please_wait {
43
 function please_wait {
37
         local str width height length
44
         local str width height length
38
 
45
 
49
 
56
 
50
 please_wait
57
 please_wait
51
 
58
 
59
+# Start including files
60
+
52
 source /usr/local/bin/${PROJECT_NAME}-vars
61
 source /usr/local/bin/${PROJECT_NAME}-vars
53
 
62
 
54
 UTILS_FILES=/usr/share/${PROJECT_NAME}/utils/${PROJECT_NAME}-utils-*
63
 UTILS_FILES=/usr/share/${PROJECT_NAME}/utils/${PROJECT_NAME}-utils-*
63
     source $f
72
     source $f
64
 done
73
 done
65
 
74
 
75
+# End including files
76
+
66
 COMPLETION_FILE=$HOME/${PROJECT_NAME}-completed.txt
77
 COMPLETION_FILE=$HOME/${PROJECT_NAME}-completed.txt
67
 SELECTED_USERNAME=
78
 SELECTED_USERNAME=
68
 SIP_CONFIGURATION_FILE=/etc/sipwitch.conf
79
 SIP_CONFIGURATION_FILE=/etc/sipwitch.conf
2146
     done
2157
     done
2147
 }
2158
 }
2148
 
2159
 
2149
-if [[ $USER != 'root' ]]; then
2150
-    # show the user version of the control panel
2151
-    ${PROJECT_NAME}-controlpanel-user
2152
-    exit 0
2153
-fi
2154
-
2155
 if [ ! -f $COMPLETION_FILE ]; then
2160
 if [ ! -f $COMPLETION_FILE ]; then
2156
     echo $'This command should only be run on an installed Freedombone system'
2161
     echo $'This command should only be run on an installed Freedombone system'
2157
     exit 1
2162
     exit 1

+ 4
- 0
src/freedombone-controlpanel-user Datei anzeigen

37
 GPG_ID=$(gpg --list-keys $MY_EMAIL_ADDRESS | sed -n '2p' | sed 's/^[ \t]*//')
37
 GPG_ID=$(gpg --list-keys $MY_EMAIL_ADDRESS | sed -n '2p' | sed 's/^[ \t]*//')
38
 GPG_BACKUP_ID=$(gpg --list-keys "(backup key)" | sed -n '2p' | sed 's/^[ \t]*//')
38
 GPG_BACKUP_ID=$(gpg --list-keys "(backup key)" | sed -n '2p' | sed 's/^[ \t]*//')
39
 
39
 
40
+# Start including files
41
+
40
 UTILS_FILES=/usr/share/${PROJECT_NAME}/utils/${PROJECT_NAME}-utils-*
42
 UTILS_FILES=/usr/share/${PROJECT_NAME}/utils/${PROJECT_NAME}-utils-*
41
 for f in $UTILS_FILES
43
 for f in $UTILS_FILES
42
 do
44
 do
49
   source $f
51
   source $f
50
 done
52
 done
51
 
53
 
54
+# End including files
55
+
52
 function any_key {
56
 function any_key {
53
     echo ' '
57
     echo ' '
54
     read -n1 -r -p $"Press any key to continue..." key
58
     read -n1 -r -p $"Press any key to continue..." key

+ 43
- 0
src/freedombone-prepare-scripts Datei anzeigen

1
+#!/bin/bash
2
+#
3
+# .---.                  .              .
4
+# |                      |              |
5
+# |--- .--. .-.  .-.  .-.|  .-. .--.--. |.-.  .-. .--.  .-.
6
+# |    |   (.-' (.-' (   | (   )|  |  | |   )(   )|  | (.-'
7
+# '    '     --'  --'  -' -  -' '  '   -' -'   -' '   -  --'
8
+#
9
+#                    Freedom in the Cloud
10
+#
11
+# Prepares control scripts
12
+#
13
+# License
14
+# =======
15
+#
16
+# Copyright (C) 2017 Bob Mottram <bob@freedombone.net>
17
+#
18
+# This program is free software: you can redistribute it and/or modify
19
+# it under the terms of the GNU Affero General Public License as published by
20
+# the Free Software Foundation, either version 3 of the License, or
21
+# (at your option) any later version.
22
+#
23
+# This program is distributed in the hope that it will be useful,
24
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
25
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
26
+# GNU Affero General Public License for more details.
27
+#
28
+# You should have received a copy of the GNU Affero General Public License
29
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
30
+
31
+PROJECT_NAME='freedombone'
32
+
33
+cat /usr/local/bin/${PROJECT_NAME}-vars /usr/share/${PROJECT_NAME}/utils/${PROJECT_NAME}-utils-* /usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-app-* > /tmp/includescripts
34
+
35
+cat /tmp/includescripts /usr/local/bin/freedombone-controlpanel > /usr/local/bin/control
36
+cat /tmp/includescripts /usr/local/bin/freedombone-controlpanel-user > /usr/local/bin/controluser
37
+
38
+sed '/# Start including files/,/# End including files/d' /usr/local/bin/control
39
+sed '/# Start including files/,/# End including files/d' /usr/local/bin/controluser
40
+
41
+rm /tmp/includescripts
42
+
43
+exit 0

+ 2
- 2
src/freedombone-utils-final Datei anzeigen

63
     echo ''
63
     echo ''
64
 
64
 
65
     # add user menu on ssh login
65
     # add user menu on ssh login
66
-    if ! grep -q 'control' /home/$MY_USERNAME/.bashrc; then
67
-        echo 'control' >> /home/$MY_USERNAME/.bashrc
66
+    if ! grep -q 'controluser' /home/$MY_USERNAME/.bashrc; then
67
+        echo 'controluser' >> /home/$MY_USERNAME/.bashrc
68
     fi
68
     fi
69
     if [ ! -f $IMAGE_PASSWORD_FILE ]; then
69
     if [ ! -f $IMAGE_PASSWORD_FILE ]; then
70
         if [ -f /root/${PROJECT_NAME}-wifi.cfg ]; then
70
         if [ -f /root/${PROJECT_NAME}-wifi.cfg ]; then

+ 2
- 2
src/freedombone-utils-web Datei anzeigen

515
 
515
 
516
     # set the home page
516
     # set the home page
517
     if ! grep -q "WWW_HOME" /home/$MY_USERNAME/.bashrc; then
517
     if ! grep -q "WWW_HOME" /home/$MY_USERNAME/.bashrc; then
518
-        if ! grep -q 'control' /home/$MY_USERNAME/.bashrc; then
518
+        if ! grep -q 'controluser' /home/$MY_USERNAME/.bashrc; then
519
             echo "export WWW_HOME=$DEFAULT_SEARCH" >> /home/$MY_USERNAME/.bashrc
519
             echo "export WWW_HOME=$DEFAULT_SEARCH" >> /home/$MY_USERNAME/.bashrc
520
         else
520
         else
521
-            sed -i "/control/i export WWW_HOME=$DEFAULT_SEARCH" /home/$MY_USERNAME/.bashrc
521
+            sed -i "/controluser/i export WWW_HOME=$DEFAULT_SEARCH" /home/$MY_USERNAME/.bashrc
522
         fi
522
         fi
523
     fi
523
     fi
524
 
524