瀏覽代碼

Use project name

Bob Mottram 7 年之前
父節點
當前提交
ff55d42e29
共有 1 個檔案被更改,包括 8 行新增8 行删除
  1. 8
    8
      src/freedombone-controlpanel

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

154
                     dialog --title $"Check tripwire" \
154
                     dialog --title $"Check tripwire" \
155
                            --msgbox $"\nThe hash should not contain any spaces" 10 40
155
                            --msgbox $"\nThe hash should not contain any spaces" 10 40
156
                 else
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
                     if [[ "$DBHASH" == "$GIVEN_HASH" ]]; then
158
                     if [[ "$DBHASH" == "$GIVEN_HASH" ]]; then
159
                         dialog --title $"Check tripwire" \
159
                         dialog --title $"Check tripwire" \
160
                                --msgbox $"\nSuccess\n\nThe hash you gave matches the current tripwire database" 10 40
160
                                --msgbox $"\nSuccess\n\nThe hash you gave matches the current tripwire database" 10 40
1305
 }
1305
 }
1306
 
1306
 
1307
 function show_tripwire_verification_code {
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
         return
1309
         return
1310
     fi
1310
     fi
1311
     clear
1311
     clear
1312
     echo ''
1312
     echo ''
1313
     echo $'Tripwire Verification Code'
1313
     echo $'Tripwire Verification Code'
1314
     echo ''
1314
     echo ''
1315
-    DBHASH=$(sha512sum  /var/lib/tripwire/${HOSTNAME}.twd)
1315
+    DBHASH=$(sha512sum  /var/lib/tripwire/${PROJECT_NAME}.twd)
1316
     echo -n "$DBHASH" | qrencode -t UTF8
1316
     echo -n "$DBHASH" | qrencode -t UTF8
1317
     echo ''
1317
     echo ''
1318
     echo "$DBHASH"
1318
     echo "$DBHASH"
1325
         any_key
1325
         any_key
1326
         return
1326
         return
1327
     fi
1327
     fi
1328
-    if [ ! -f /etc/tripwire/${HOSTNAME}-local.key ]; then
1328
+    if [ ! -f /etc/tripwire/${PROJECT_NAME}-local.key ]; then
1329
         echo $'Error: missing local key'
1329
         echo $'Error: missing local key'
1330
         any_key
1330
         any_key
1331
         return
1331
         return
1338
     echo $'Creating configuration...'
1338
     echo $'Creating configuration...'
1339
     echo '
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
     echo $'Resetting policy...'
1342
     echo $'Resetting policy...'
1343
     echo '
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
     echo $'Creating tripwire database'
1346
     echo $'Creating tripwire database'
1347
     echo '
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
     echo $'Resetting the Tripwire...'
1350
     echo $'Resetting the Tripwire...'
1351
     echo ''
1351
     echo ''
1352
     echo '
1352
     echo '
1361
         systemctl restart nginx
1361
         systemctl restart nginx
1362
     fi
1362
     fi
1363
 
1363
 
1364
-    if [ -f /var/lib/tripwire/${HOSTNAME}.twd ]; then
1364
+    if [ -f /var/lib/tripwire/${PROJECT_NAME}.twd ]; then
1365
         show_tripwire_verification_code
1365
         show_tripwire_verification_code
1366
         echo $'Tripwire is now reset. Take a note of the above hash, or record'
1366
         echo $'Tripwire is now reset. Take a note of the above hash, or record'
1367
         echo $'the QR code using a mobile device. This will enable you to independently'
1367
         echo $'the QR code using a mobile device. This will enable you to independently'