浏览代码

Use project name

Bob Mottram 7 年前
父节点
当前提交
ff55d42e29
共有 1 个文件被更改,包括 8 次插入8 次删除
  1. 8
    8
      src/freedombone-controlpanel

+ 8
- 8
src/freedombone-controlpanel 查看文件

@@ -154,7 +154,7 @@ function any_key_verify {
154 154
                     dialog --title $"Check tripwire" \
155 155
                            --msgbox $"\nThe hash should not contain any spaces" 10 40
156 156
                 else
157
-                    DBHASH=$(sha512sum  /var/lib/tripwire/${HOSTNAME}.twd | awk -F ' ' '{print $1}')
157
+                    DBHASH=$(sha512sum  /var/lib/tripwire/${PROJECT_NAME}.twd | awk -F ' ' '{print $1}')
158 158
                     if [[ "$DBHASH" == "$GIVEN_HASH" ]]; then
159 159
                         dialog --title $"Check tripwire" \
160 160
                                --msgbox $"\nSuccess\n\nThe hash you gave matches the current tripwire database" 10 40
@@ -1305,14 +1305,14 @@ function security_settings {
1305 1305
 }
1306 1306
 
1307 1307
 function show_tripwire_verification_code {
1308
-    if [ ! -f /var/lib/tripwire/${HOSTNAME}.twd ]; then
1308
+    if [ ! -f /var/lib/tripwire/${PROJECT_NAME}.twd ]; then
1309 1309
         return
1310 1310
     fi
1311 1311
     clear
1312 1312
     echo ''
1313 1313
     echo $'Tripwire Verification Code'
1314 1314
     echo ''
1315
-    DBHASH=$(sha512sum  /var/lib/tripwire/${HOSTNAME}.twd)
1315
+    DBHASH=$(sha512sum  /var/lib/tripwire/${PROJECT_NAME}.twd)
1316 1316
     echo -n "$DBHASH" | qrencode -t UTF8
1317 1317
     echo ''
1318 1318
     echo "$DBHASH"
@@ -1325,7 +1325,7 @@ function reset_tripwire {
1325 1325
         any_key
1326 1326
         return
1327 1327
     fi
1328
-    if [ ! -f /etc/tripwire/${HOSTNAME}-local.key ]; then
1328
+    if [ ! -f /etc/tripwire/${PROJECT_NAME}-local.key ]; then
1329 1329
         echo $'Error: missing local key'
1330 1330
         any_key
1331 1331
         return
@@ -1338,15 +1338,15 @@ function reset_tripwire {
1338 1338
     echo $'Creating configuration...'
1339 1339
     echo '
1340 1340
 
1341
-       ' | twadmin --create-cfgfile -S /etc/tripwire/${HOSTNAME}-site.key /etc/tripwire/twcfg.txt
1341
+       ' | twadmin --create-cfgfile -S /etc/tripwire/${PROJECT_NAME}-site.key /etc/tripwire/twcfg.txt
1342 1342
     echo $'Resetting policy...'
1343 1343
     echo '
1344 1344
 
1345
-       ' | twadmin --create-polfile -S /etc/tripwire/${HOSTNAME}-site.key /etc/tripwire/twpol.txt
1345
+       ' | twadmin --create-polfile -S /etc/tripwire/${PROJECT_NAME}-site.key /etc/tripwire/twpol.txt
1346 1346
     echo $'Creating tripwire database'
1347 1347
     echo '
1348 1348
 
1349
-' | tripwire --init --cfgfile /etc/tripwire/tw.cfg --polfile /etc/tripwire/tw.pol --dbfile /var/lib/tripwire/${HOSTNAME}.twd
1349
+' | tripwire --init --cfgfile /etc/tripwire/tw.cfg --polfile /etc/tripwire/tw.pol --dbfile /var/lib/tripwire/${PROJECT_NAME}.twd
1350 1350
     echo $'Resetting the Tripwire...'
1351 1351
     echo ''
1352 1352
     echo '
@@ -1361,7 +1361,7 @@ function reset_tripwire {
1361 1361
         systemctl restart nginx
1362 1362
     fi
1363 1363
 
1364
-    if [ -f /var/lib/tripwire/${HOSTNAME}.twd ]; then
1364
+    if [ -f /var/lib/tripwire/${PROJECT_NAME}.twd ]; then
1365 1365
         show_tripwire_verification_code
1366 1366
         echo $'Tripwire is now reset. Take a note of the above hash, or record'
1367 1367
         echo $'the QR code using a mobile device. This will enable you to independently'