Selaa lähdekoodia

Experimental control scripts

Bob Mottram 7 vuotta sitten
vanhempi
commit
8c20b15f6f

+ 4
- 1
Makefile Näytä tiedosto

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

+ 2
- 2
src/freedombone-adduser Näytä tiedosto

@@ -235,8 +235,8 @@ if [ -f /etc/nginx/.htpasswd ]; then
235 235
 fi
236 236
 
237 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 240
 fi
241 241
 
242 242
 ${PROJECT_NAME}-pass -u $ADD_USERNAME -a login -p "$NEW_USER_PASSWORD"

+ 3
- 0
src/freedombone-app-ghost Näytä tiedosto

@@ -322,6 +322,9 @@ function remove_ghost {
322 322
 function ghost_create_config {
323 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 328
     echo "var path = require('path')," > $ghost_config
326 329
     echo '    config;' >> $ghost_config
327 330
     echo '' >> $ghost_config

+ 11
- 6
src/freedombone-controlpanel Näytä tiedosto

@@ -33,6 +33,13 @@ PROJECT_NAME='freedombone'
33 33
 export TEXTDOMAIN=${PROJECT_NAME}-controlpanel
34 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 43
 function please_wait {
37 44
         local str width height length
38 45
 
@@ -49,6 +56,8 @@ function please_wait {
49 56
 
50 57
 please_wait
51 58
 
59
+# Start including files
60
+
52 61
 source /usr/local/bin/${PROJECT_NAME}-vars
53 62
 
54 63
 UTILS_FILES=/usr/share/${PROJECT_NAME}/utils/${PROJECT_NAME}-utils-*
@@ -63,6 +72,8 @@ do
63 72
     source $f
64 73
 done
65 74
 
75
+# End including files
76
+
66 77
 COMPLETION_FILE=$HOME/${PROJECT_NAME}-completed.txt
67 78
 SELECTED_USERNAME=
68 79
 SIP_CONFIGURATION_FILE=/etc/sipwitch.conf
@@ -2146,12 +2157,6 @@ function menu_top_level {
2146 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 2160
 if [ ! -f $COMPLETION_FILE ]; then
2156 2161
     echo $'This command should only be run on an installed Freedombone system'
2157 2162
     exit 1

+ 4
- 0
src/freedombone-controlpanel-user Näytä tiedosto

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

+ 43
- 0
src/freedombone-prepare-scripts Näytä tiedosto

@@ -0,0 +1,43 @@
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 Näytä tiedosto

@@ -63,8 +63,8 @@ $(get_ssh_server_key)
63 63
     echo ''
64 64
 
65 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 68
     fi
69 69
     if [ ! -f $IMAGE_PASSWORD_FILE ]; then
70 70
         if [ -f /root/${PROJECT_NAME}-wifi.cfg ]; then

+ 2
- 2
src/freedombone-utils-web Näytä tiedosto

@@ -515,10 +515,10 @@ function install_command_line_browser {
515 515
 
516 516
     # set the home page
517 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 519
             echo "export WWW_HOME=$DEFAULT_SEARCH" >> /home/$MY_USERNAME/.bashrc
520 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 522
         fi
523 523
     fi
524 524