dugout-> wrappers
Define, Modify, Extend New Entity AI™ wrapper-constructs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
#!/bin/sh
###############################################################################
## COPYRIGHT (C) 2020-2026 NEW ENTITY OPERATIONS INC. ALL RIGHTS RESERVED
## INSTANCE: dugout/wrappers.sh
## MODIFIED: 2026/04/20
## OVERVIEW: provide generic wrappers to minter instances: Provide a basic
## Determine, Extend, Modify (DEM) pipeline
###############################################################################
## Plans
###############################################################################
## 1.) Need to update network scripts to include feedback-responses for -p and -P ports
## - scp, ssh
###############################################################################
## Provide basic environment-based operations wrappers. The defaults are:
## determine_*: fork behavior from specific environment segments
## extend_*: provide extensions to speicific environment segments
## modify_*: alter the behavior of an environment described instance
## perform_*: use the OS base functionality to perform system operations
## Any macros or automated task that takes advantage of another
## provided system interface or API
## There are five general states
## 1.) none: This provides no additional checks within the wrapper
## 2.) lockddown: This provides the most checks. Checking both to see if the
## location is valid, and making the user confirm first before moving
## forward. There is also a provided program termination key
## 3.) protected: This protects against a location being passed that isnt'
## valid
## 4.) Notes on Perform:
## Perform-> Create
## pcd: Perform-> creation of a directory
## pcf: Perform-> creation of a file
## Perform-> Modification
## pmog: Perform-> modification of owner for a generic instance
## pmpg: Perform-> modification of permissions for a generic instance
## Perform-> Move
## pmg: Perform-> move of a generic instance
## pmri: Perform-> move of a generic instance via the rename method
## Perform-> Removal
## prg: Perform-> removal of a generic instance
## ptw: Perform-> tree walk
## ValueS*: Value Slot, 1->N
## 5.) helper: General wrappers to assist in running other nested programs
## Any script that provides a virtual runtime wrapper to a
## system binary or script
## STATE_*: A special operator used to signify a system resource that
## can be adjusted, or changed, according to a provided sub-unit
## state-based instruction.
###############################################################################
## SKIP_BIT_SET: Set a bit to 1 if you want to skip all of the prompted
## opeations with auto-providing 1
## If you change from 0 to 1, or 1 to 0, make sure to restart the environment
## so your variable updates, or source it manually by setting SKIP_BIT_SET=X
###############################################################################
## ALERTS_*
export ALERTS_WRAPPER="${CONFIGURATION_ALERTS_WRAPPER}"
## DIRECTORY_CREATION_
export DIRECTORY_CREATION_OWNER_GENERIC="${CONFIGURATION_DIRECTORY_CREATION_OWNER_GENERIC}"
export DIRECTORY_CREATION_PERMISSIONS_GENERIC="${CONFIGURATION_DIRECTORY_CREATION_PERMISSIONS_GENERIC}"
## FILE_CREATION_*
export FILE_CREATION_OWNER_GENERIC="${CONFIGURATION_FILE_CREATION_OWNER_GENERIC}"
export FILE_CREATION_PERMISSIONS_GENERIC="${CONFIGURATION_FILE_CREATION_PERMISSIONS_GENERIC}"
## GENERIC_*
export GENERIC_CREATION_OWNER_DIRECTORY="${CONFIGURATION_GENERIC_CREATION_OWNER_DIRECTORY}"
export GENERIC_CREATION_OWNER_FILE="${CONFIGURATION_GENERIC_CREATION_OWNER_FILE}"
export GENERIC_CREATION_PERMISSIONS_DIRECTORY="${CONFIGURATION_GENERIC_CREATION_PERMISSIONS_DIRECTORY}"
export GENERIC_CREATION_PERMISSIONS_FILE="${CONFIGURATION_GENERIC_CREATION_PERMISSIONS_FILE}"
## SKIP_BIT_SET
export SKIP_BIT_SET="${CONFIGURATION_SKIP_BIT_SET}"
## TRINE_CONTROL_VERBOSE default
export TRINE_CONTROL_VERBOSE=0
## VERBOSE_CONTEXT
export VERBOSE_CONTEXT="${CONFIGURATION_VERBOSE_CONTEXT}"
###############################################################################
## Alert
###############################################################################
## alert_acs_no
alert_acs_no() {
if [ "${1}" = "clean" ]; then
:
elif [ "${1}" = "cleanse" ]; then
:
elif [ "${1}" = "configure" ]; then
:
elif [ "${1}" = "controls" ]; then
:
elif [ "${1}" = "display" ]; then
:
elif [ "${1}" = "dugout" ]; then
:
elif [ "${1}" = "minter" ]; then
:
elif [ "${1}" = "operations" ]; then
:
elif [ "${1}" = "optional" ]; then
:
elif [ "${1}" = "perform" ]; then
:
elif [ "${1}" = "state_modifier" ]; then
:
elif [ "${1}" = "state_summarize" ]; then
:
elif [ "${1}" = "state_summary" ]; then
:
else
:
fi
}
## alert_acs_yes
alert_acs_yes() {
if [ "${1}" = "clean" ]; then
printf "ACS is-> %s\n" "${SCRIPT_ACS_RUNNER_CLEAN}"
elif [ "${1}" = "cleanse" ]; then
printf "ACS is-> %s\n" "${SCRIPT_ACS_RUNNER_CLEANSE}"
elif [ "${1}" = "configure" ]; then
printf "ACS is-> %s\n" "${SCRIPT_ACS_RUNNER_CONFIGURE}"
elif [ "${1}" = "controls" ]; then
printf "ACS is-> %s\n" "${SCRIPT_ACS_RUNNER_CONTROLS}"
elif [ "${1}" = "display" ]; then
printf "ACS is-> %s\n" "${SCRIPT_ACS_RUNNER_DISPLAY}"
elif [ "${1}" = "dugout" ]; then
printf "ACS is-> %s\n" "${SCRIPT_ACS_RUNNER_DUGOUT}"
elif [ "${1}" = "minter" ]; then
printf "ACS is-> %s\n" "${SCRIPT_ACS_RUNNER_MINTER}"
elif [ "${1}" = "operations" ]; then
printf "ACS is-> %s\n" "${SCRIPT_ACS_RUNNER_OPERATIONS}"
elif [ "${1}" = "optional" ]; then
printf "ACS is-> %s\n" "${SCRIPT_ACS_RUNNER_OPTIONAL}"
elif [ "${1}" = "perform" ]; then
printf "ACS is-> %s\n" "${SCRIPT_ACS_RUNNER_PERFORM}"
elif [ "${1}" = "state_modifier" ]; then
printf "ACS is-> %s\n" "${SCRIPT_ACS_RUNNER_STATE_MODIFIER}"
elif [ "${1}" = "state_summarize" ]; then
printf "ACS is-> %s\n" "${SCRIPT_ACS_RUNNER_STATE_SUMMARIZE}"
elif [ "${1}" = "state_summary" ]; then
printf "ACS is-> %s\n" "${SCRIPT_ACS_RUNNER_STATE_SUMMARY}"
else
printf "ACS is-> unspecified\n"
fi
}
## alert_backup_*
alert_backup_custom_starting() {
printf " -> STARTING: %bcustom backup%b\n" "${tmodSuccess}" "${tmodReset}"
printf " -> LOCATION: From-> %b%s%b To-> %b%s%b\n" "${tmodOperator}" "${1}" "${tmodReset}" "${tmodOperator}" "${2}" "${tmodReset}"
}
alert_backup_from_location_not_valid() {
printf " -> FAILED: from location-> %b%s%b was not located
* * You need to provide a valid location to backup from!\n" "${tmodFailure}" "${1}" "${tmodReset}"
}
alert_backup_rule_instance() {
printf "%b%s%b\n" "${tmodWarning}" "${1}" "${tmodReset}"
}
alert_backup_location_not_valid() {
printf " -> FAILED: to location-> %b%s%b doesn't exist
* * You need to send the backup to a valid location. Try again with valid backup-destination instead.\n" "${tmodFailure}" "${1}" "${tmodReset}"
}
alert_backup_redundant_location() {
printf " -> REDUNDANT LOCATION: %b%s-> %s%b\n" "${tmodCyanF}" "${1}" "${2}" "${tmodReset}"
}
alert_backup_ruleset_defined() {
printf " -> ALERT: A valid backup ruleset was defined in -> %b%s%b\n" "${tmodFailure}" "${1}" "${tmodReset}"
}
alert_backup_ruleset_not_defined() {
printf " -> ALERT: %bNo valid backup ruleset was defined in -> NONE%b\n" "${tmodWarning}" "${tmodReset}"
}
alert_backup_standard_starting() {
printf " -> STARTING: %bcustom backup%b\n" "${tmodSuccess}" "${tmodReset}"
printf " -> LOCATION: From-> %b%s%b To-> %b%s%b\n" "${tmodOperator}" "${1}" "${tmodReset}" "${tmodOperator}" "${2}" "${tmodReset}"
}
alert_backup_system_starting() {
printf " -> STARTING: %bsystem backup%b\n" "${tmodSuccess}" "${tmodReset}"
printf " -> LOCATION: From-> %b%s%b To-> %b%s%b\n" "${tmodOperator}" "${1}" "${tmodReset}" "${tmodOperator}" "${2}" "${tmodReset}"
}
alert_backup_to_location_not_valid() {
printf " -> FAILED: %b%s was not located. Make sure that the system path you're sourcing exists or that it is set properly.\n" "${tmodFailure}" "${1}" "${tmodReset}"
}
## alert_chmod*
alert_chmod() {
if [ "${ALERTS_WRAPPER}" -eq 0 ]; then
:
else
if [ "${FAILED_CHECK}" -eq 1 ]; then
printf " -> %bFAILED-> %s:%b %s <> %s\n" "${tmodFailure}" "${3}" "${tmodReset}" "${1}" "${2}"
export FAILED_CHECK=0
else
printf " -> %b%s:%b %s <> %s\n" "${tmodSuccess}" "${3}" "${tmodReset}" "${1}" "${2}"
export FAILED_CHECK=0
fi
fi
}
alert_chmod_lockeddown() {
if [ "${ALERTS_WRAPPER}" -eq 0 ]; then
:
else
if [ "${FAILED_CHECK}" -eq 1 ]; then
printf " <*L*> %bFAILED-> %s:%b %s <> %s\n" "${tmodFailed}" "${3}" "${tmodReset}" "${1}" "${2}"
export FAILED_CHECK=0
else
printf " <*L*> %b%s:%b %s <> %s\n" "${tmodSuccess}" "${3}" "${tmodReset}" "${1}" "${2}"
export FAILED_CHECK=0
fi
fi
}
alert_chmod_protected() {
if [ "${ALERTS_WRAPPER}" -eq 0 ]; then
:
else
if [ "${FAILED_CHECK}" -eq 1 ]; then
printf " <protected> %bFAILED-> %s:%b %s <> %s\n" "${tmodFailure}" "${3}" "${tmodReset}" "${1}" "${2}"
export FAILED_CHECK=0
else
printf " <protected> %b%s:%b %s <> %s\n" "${tmodSuccess}" "${3}" "${tmodReset}" "${1}" "${2}"
export FAILED_CHECK=0
fi
fi
}
## alert_chown*
alert_chown() {
if [ "${ALERTS_WRAPPER}" -eq 0 ]; then
:
else
if [ "${FAILED_CHECK}" -eq 1 ]; then
printf " -> %bFAILED-> %s:%b %s (%s)\n" "${tmodFailure}" "${3}" "${tmodReset}" "${1}" "${2}"
export FAILED_CHECK=0
else
printf " -> %b%s:%b %s (%s)\n" "${tmodSuccess}" "${3}" "${tmodReset}" "${1}" "${2}"
export FAILED_CHECK=0
fi
fi
}
alert_chown_lockeddown() {
if [ "${ALERTS_WRAPPER}" -eq 0 ]; then
:
else
if [ "${FAILED_CHECK}" -eq 1 ]; then
printf " <*L*> %bFAILED-> %s:%b %s (%s)\n" "${tmodFailure}" "${3}" "${tmodReset}" "${1}" "${2}"
export FAILED_CHECK=0
else
printf " <*L*> %b%s:%b %s (%s)\n" "${tmodSuccess}" "${3}" "${tmodReset}" "${1}" "${2}"
export FAILED_CHECK=0
fi
fi
}
alert_chown_protected() {
if [ "${ALERTS_WRAPPER}" -eq 0 ]; then
:
else
if [ "${FAILED_CHECK}" -eq 1 ]; then
printf " <protected> %bFAILED-> %s:%b %s (%s)\n" "${tmodSuccess}" "${3}" "${tmodReset}" "${1}" "${2}"
export FAILED_CHECK=0
else
printf " <protected> %b%s:%b %s (%s)\n" "${tmodSuccess}" "${3}" "${tmodReset}" "${1}" "${2}"
export FAILED_CHECK=0
fi
fi
}
## alert_confirmation_*
alert_confirmation_already_exists_overwrite() {
if [ "${ALERTS_WRAPPER}" -eq 0 ]; then
:
else
printf "This location already exists-> Overwrite?: \n"
fi
}
alert_confirmation_check_if_directory_transfer_exists() {
printf "Do you want to see if the provided slug is within your current directory?: \n"
}
## alert_connection_*
alert_connection_args_from() {
printf "Updated dynamic connection routine-> COMMAND_CONNECTION_ARGS_FROM: %s\n" "${1}"
}
alert_connection_args_to() {
printf "Updated dynamic connection routine-> COMMAND_CONNECTION_ARGS_TO: %s\n" "${1}"
}
alert_connection_destination_invalid() {
printf "Error-> %b%s%b is not a valid destination directory.\n" "${tmodFailure}" "${1}" "${tmodReset}"
}
alert_connection_details_summary() {
printf " -> %bssh -i %s -p %s %s@%s%b\n" "${tmodCyanF}" "${1}" "${2}" "${3}" "${4}" "${tmodReset}"
}
alert_connection_initiated_scp() {
printf "Connection initiated (scp): %b%b %s %b\n" "${tmodLabelHeading}" "${tmodStartBold}" "${1}" "${tmodReset}"
}
alert_connection_initiated_ssh() {
printf "Connection initiated (SSH): %b%b %s %b\n" "${tmodLabelHeading}" "${tmodStartBold}" "${1}" "${tmodReset}"
}
alert_connection_to_destination_with_user() {
printf " * * CONNECTING to %s with user %s * * \n" "${1}" "${2}"
}
alert_connection_scp_archive_unavailable() {
printf "Error-> %b%s%b There wasn't an archive available at that location to transfer.\n" "${tmodFailure}" "${1}" "${tmodReset}"
}
alert_connection_scp_archive_unavailable_custom() {
printf "Error-> custom: %b%s%b There wasn't an archive available at that location to transfer.\n" "${tmodFailure}" "${1}" "${tmodReset}"
}
alert_connection_scp_archive_unavailable_no_checks() {
printf "Error-> %bTransfer: No archive was available to transfer, and no check was performed to see if there was a transfer-ready directory available. The action was terminated with 0.%b\n" "${tmodFailure}" "${tmodReset}"
}
alert_connection_scp_internal_branch_in_use() {
printf "Using a specific interal branch id: %b %s %b\n" "${tmodCyanF}" "${1}" "${tmodReset}"
}
alert_connection_scp_external_branch_exists() {
printf "The external branch: %b %s %b already exists\n" "${tmodCyanF}" "${1}" "${tmodReset}"
}
alert_connection_scp_external_branch_does_not_exists() {
printf "The external branch: %b %s %b does not exist\n" "${tmodCyanF}" "${1}" "${tmodReset}"
}
alert_connection_scp_internal_branch_exists() {
printf "The internal branch: %b %s %b already exists\n" "${tmodCyanF}" "${1}" "${tmodReset}"
}
alert_connection_scp_internal_branch_does_not_exists() {
printf "The internal branch: %b %s %b does not exist\n" "${tmodCyanF}" "${1}" "${tmodReset}"
}
alert_connection_scp_summary_external() {
printf " -> %bscp -i %s -P %s %s@%s:/home/%s/%s/%s%s %b\n" "${tmodCyanF}" "${1}" "${2}" "${3}" "${4}" "${5}" "${6}" "${7}" "${8}" "${tmodReset}"
printf " -> copying a external branch: %b %s %b : to : %b %s %b\n" "${tmodCyanF}" "/home/${3}/${6}/${7}${8}" "${tmodReset}" "${tmodCyanF}" "${9}" "${tmodReset}"
}
alert_connection_scp_summary_internal_directory() {
printf " -> valid internal directory location found\n"
printf " -> %bscp -i %s -P %s -r %s %s@%s:/home/%s/%s %b\n" "${tmodCyanF}" "${1}" "${2}" "${3}" "${4}" "${5}" "${6}" "${7}" "${tmodReset}"
printf " -> copying the internal branch: %b %s %b : to an external branch: %b %s %b \n" "${tmodCyanF}" "${3}" "${tmodReset}" "${tmodCyanF}" "${4}@${5}:/home/${4}/${6}/" "${tmodReset}"
}
alert_connection_scp_summary_internal_file() {
printf " -> valid internal file location found\n"
printf " -> %bscp -i %s -P %s -r %s %s@%s:/home/%s/%s %b\n" "${tmodCyanF}" "${1}" "${2}" "${3}" "${4}" "${5}" "${6}" "${7}" "${tmodReset}"
printf " -> copying the internal branch: %b %s %b : to an external branch: %b %s %b \n" "${tmodCyanF}" "${3}" "${tmodReset}" "${tmodCyanF}" "${4}@${5}:/home/${4}/${6}/" "${tmodReset}"
}
alert_connection_scp_summary_internal_custom_directory() {
printf " -> valid custom directory location found\n"
printf " -> %bscp -i %s -P %s -r %s %s@%s:/home/%s/%s %b\n" "${tmodCyanF}" "${1}" "${2}" "${3}" "${4}" "${5}" "${6}" "${7}" "${tmodReset}"
printf " -> copying the custom internal loocation: %b %s %b : to an external branch: %b %s %b \n" "${tmodCyanF}" "${3}" "${tmodReset}" "${tmodCyanF}" "${4}@${5}:/home/${4}/${6}/${3}" "${tmodReset}"
}
alert_connection_scp_summary_internal_custom_file() {
printf " -> valid custom file location found\n"
printf " -> %bscp -i %s -P %s %s %s@%s:/home/%s/%s %b\n" "${tmodCyanF}" "${1}" "${2}" "${3}" "${4}" "${5}" "${6}" "${7}" "${tmodReset}"
printf " -> copying the custom internal loocation: %b %s %b : to an external branch: %b %s %b \n" "${tmodCyanF}" "${3}" "${tmodReset}" "${tmodCyanF}" "${4}@${5}:/home/${4}/${6}/${3}" "${tmodReset}"
}
alert_connection_scp_summary_internal_archive() {
printf " -> %bscp -i %s -P %s %s@%s:/home/%s/%s %b\n" "${tmodCyanF}" "${1}" "${2}" "${3}" "${4}" "${5}" "${6}" "${tmodReset}"
printf " -> copying the internal branch: %b %s %b : to an external branch: %b %s %b \n" "${tmodCyanF}" "${1}${3}" "${tmodReset}" "${tmodCyanF}" "${4}@${5}:/home/${4}/${6}/" "${tmodReset}"
}
alert_connection_special_branch_logic(){
printf "Using a specific external branch id: %b %s %b\n" "${tmodCyanF}" "${1}" "${tmodReset}"
printf " -> %bscp -i %s -P %s %s@%s:%s %b\n" "${tmodCyanF}" "${1}" "${2}" "${3}" "${4}" "${5}" "${tmodReset}"
printf " -> copying a external branch: %b %s %b : to : %b %s %b \n" "${tmodCyanF}" "${7}" "${tmodReset}" "${tmodCyanF}" "${6}" "${tmodReset}"
}
## Correct
alert_connection_ssh_summary() {
printf " -> %bssh -i %s -p %s %s@%s:%s%b\n" "${tmodCyanF}" "${1}" "${2}" "${3}" "${4}" "${5}" "${tmodReset}"
}
alert_connection_terminated_with_key() {
printf "Error-> %bTransfer: The existing location won't be overwritten, and the action was terminated with 0.%b\n" "${tmodFailure}" "${tmodReset}"
}
# alert_destruction_*
alert_destruction_key_activated() {
if [ "${ALERTS_WRAPPER}" -eq 0 ]; then
:
else
printf "The operation was terminated by the user with the destruction key: 0\n"
fi
}
## alert_disk_ops_*
alert_disk_ops_directory_generic_from() {
printf "Directory located-> from: %b%s%b\n" "${tmodOperator}" "${1}" "${tmodReset}"
}
alert_disk_ops_directory_located() {
printf "Directory located-> %b%s%b\n" "${tmodOperator}" "${1}" "${tmodReset}"
}
alert_disk_ops_directory_slug_located() {
printf "Directory located-> slug: %b%s%b\n" "${tmodOperator}" "${1}" "${tmodReset}"
}
alert_disk_ops_archive_1_started() {
printf "System Archive-> archive started from PRIMARY ARCHIVE (ARCHIVE 1): to ARCHIVE 2::: Preparing to perform the primary archive backup routine now...\n"
}
alert_disk_ops_full_archive_now() {
printf "System Archive-> backup starting: Preparing to perform the full archive backup routine now...\n"
}
alert_disk_ops_full_archive_adult_now() {
printf "Adult Content Archive-> adult content archive starting: Preparing to perform the full adult content archive routine now...\n"
}
alert_disk_ops_full_archive_started() {
printf "System Process-> backup started: Performing the full archive backup routine now...\n"
}
alert_disk_ops_full_clone_default_now() {
printf "System Archive-> default system cloning starting: Preparing to perform the full system cloning routine now...\n"
}
alert_disk_ops_full_clone_server_started() {
printf "System Archive-> server cloning started: Preparing to perform the full server cloning routine now...\n"
}
alert_disk_ops_full_clone_adult_started() {
printf "Adult Content Archive-> adult content archive starting: Preparing to perform the full adult content archive routine now...\n"
}
alert_disk_ops_full_clone_server_now() {
printf "System Archive-> server cloning starting: Preparing to perform the full server cloning routine now...\n"
}
alert_disk_ops_full_extra_archive_now() {
printf "EXTRA Archive-> extra archiving starting: Preparing to perform the full EXTRA archive routine now...\n"
}
alert_disk_ops_initialized() {
printf "INITIALIZED -> ARCHIVING <> <> <>\n"
}
alert_disk_ops_initialized_partial() {
printf "INITIALIZED -> ARCHIVING <partial> <%s> <slug>\n" "${1}"
}
alert_disk_ops_locate_rules() {
printf " -> SEARCHING: Looking for a valid storage rule-set now\n"
}
alert_disk_ops_redundant_archive_initialized() {
printf " -> REDUNDANT ARCHIVE: initialized\n"
}
alert_disk_ops_redundant_archive_starting() {
printf " -> starting: redundant %s archive initialized: n->(%s)\n" "${1}" "${2}"
}
alert_disk_ops_view_root_directory() {
printf "root directory-> / : Overview\n"
}
## alert_find*
alert_find_and_modify() {
if [ "${ALERTS_WRAPPER}" -eq 0 ]; then
:
else
if [ "${FAILED_CHECK}" -eq 1 ]; then
printf " -> %b%s:%b sudo %s %s -type %s -exec %s %s {} \;\n" "${tmodFailure}" "${3}" "${tmodReset}" "${1}" "${2}" "${3}" "${4}" "${5}"
export FAILED_CHECK=0
else
printf " -> %b%s:%b sudo %s %s -type %s -exec %s %s {} \;\n" "${tmodSuccess}" "${3}" "${tmodReset}" "${1}" "${2}" "${3}" "${4}" "${5}"
export FAILED_CHECK=0
fi
fi
}
alert_find_and_modify_lockeddown() {
if [ "${ALERTS_WRAPPER}" -eq 0 ]; then
:
else
if [ "${FAILED_CHECK}" -eq 1 ]; then
printf " <*L*> %bFAILED-> %s:%b sudo %s %s -type %s -exec %s %s {} \;\n" "${tmodSuccess}" "${3}" "${tmodReset}" "${1}" "${2}" "${3}" "${4}" "${5}"
export FAILED_CHECK=0
else
printf " <*L*> %b%s:%b sudo %s %s -type %s -exec %s %s {} \;\n" "${tmodSuccess}" "${3}" "${tmodReset}" "${1}" "${2}" "${3}" "${4}" "${5}"
export FAILED_CHECK=0
fi
fi
}
alert_find_and_modify_protected() {
if [ "${ALERTS_WRAPPER}" -eq 0 ]; then
:
else
if [ "${FAILED_CHECK}" -eq 1 ]; then
printf " <protected> %bFAILED-> %s:%b sudo %s %s -type %s -exec %s %s {} \;\n" "${tmodFailure}" "${3}" "${tmodReset}" "${1}" "${2}" "${3}" "${4}" "${5}"
export FAILED_CHECK=0
else
printf " <protected> %b%s:%b sudo %s %s -type %s -exec %s %s {} \;\n" "${tmodSuccess}" "${3}" "${tmodReset}" "${1}" "${2}" "${3}" "${4}" "${5}"
export FAILED_CHECK=0
fi
fi
}
## alert_invalid_property
alert_invalid_property() {
if [ "${ALERTS_WRAPPER}" -eq 0 ]; then
:
else
printf "%bInvalid property: Can't alter %s%b\n" "${tmodYellowF}" "${1}" "${tmodReset}"
fi
}
## alert_instance*(
alert_instance_not_immutable() {
if [ "${ALERTS_WRAPPER}" -eq 0 ]; then
:
else
printf " -> %b%s is no longer immutable%b\n" "${tmodYellowF}" "${1}" "${tmodReset}"
fi
}
alert_instance_not_immutable_lockeddown() {
if [ "${ALERTS_WRAPPER}" -eq 0 ]; then
:
else
printf " <*L*> %b%s is no longer immutable%b\n" "${tmodYellowF}" "${1}" "${tmodReset}"
fi
}
alert_instance_not_immutable_protected() {
if [ "${ALERTS_WRAPPER}" -eq 0 ]; then
:
else
printf " <protected> %b%s is no longer immutable%b\n" "${tmodYellowF}" "${1}" "${tmodReset}"
fi
}
alert_instance_now_immutable() {
if [ "${ALERTS_WRAPPER}" -eq 0 ]; then
:
else
printf " -> %b%s is now longer immutable%b\n" "${tmodYellowF}" "${1}" "${tmodReset}"
fi
}
alert_instance_now_immutable_lockeddown() {
if [ "${ALERTS_WRAPPER}" -eq 0 ]; then
:
else
printf " <*L*> %b%s is now immutable%b\n" "${tmodYellowF}" "${1}" "${tmodReset}"
fi
}
alert_instance_now_immutable_protected() {
if [ "${ALERTS_WRAPPER}" -eq 0 ]; then
:
else
printf " <protected> %b%s is now immutable%b\n" "${tmodYellowF}" "${1}" "${tmodReset}"
fi
}
## alert_location_*
alert_location_not_found() {
printf "The location %b%s%b doesn't exist.\n" "${tmodFailure}" "${1}" "${tmodReset}"
}
alert_location_open_not_found() {
printf "Open Location-> Not Found: %b%s%b\n" "${tmodFailure}" "${1}" "${tmodReset}"
}
alert_location_special_not_found() {
printf "Special Location-> Not Available: %b%s%b\n" "${tmodFailure}" "${1}" "${tmodReset}"
}
## alert_lockerlink_*
alert_lockerlink_not_found() {
printf "LockerLink-> Not Found: %b%s%b\n" "${tmodFailure}" "${1}" "${tmodReset}"
}
## alert_path*
alert_path_not_located() {
if [ "${ALERTS_WRAPPER}" -eq 0 ]; then
:
else
printf " -> PATH: %b%s was not located%b\n" "${tmodYellowF}" "${1}" "${tmodReset}"
fi
}
## alert_proxy_*
alert_proxy_asign_complex() {
if [ "${ALERTS_WRAPPER}" -eq 0 ]; then
:
else
printf "Assigning Proxy-> http://%s:**********@%s:%s (NO-PROXY-> %s)\n" "${1}" "${2}" "${3}" "${4}"
fi
}
alert_proxy_asign_failure_empty() {
if [ "${ALERTS_WRAPPER}" -eq 0 ]; then
:
else
printf "You need to provide a fully qualified proxy endpoint with a valid user to use with the assignProxy function.\n"
printf "Use-> vXProxy *proxy_value* *no_proxy_value* *proxy_user* *proxy_user_password* \n"
printf "Use-> vXProxy <ADDRESS_TO_PASS>:<PORT_TO_PASS> <EXCLUDED_OPTIONAL_ADDRESSES> <PROXY_USER_TO_PASS>\n"
fi
}
alert_proxy_asign_simple() {
if [ "${ALERTS_WRAPPER}" -eq 0 ]; then
:
else
printf "Assigning Proxy-> http://%s:**********@%s (NO-PROXY-> N%s)\n" "${1}" "${2}" "${3}"
fi
}
alert_proxy_asign_standard() {
if [ "${ALERTS_WRAPPER}" -eq 0 ]; then
:
else
printf "Assigning Proxy-> http://%s:%s ::: No Proxy-> %s\n" "${1}" "${2}" "${3}"
fi
}
alert_proxy_instructions() {
if [ "${ALERTS_WRAPPER}" -eq 0 ]; then
:
else
printf "You need to provide a fully qualified proxy endpoint to use the assignProxy function."
printf "Use-> assignProxy 'proxy_value' 'no_proxy_value'"
printf "Use-> assignProxy http://sally:passwordforsally@10.22.10.11:44200 localhost,127.0.0.1"
fi
}
alert_proxy_is() {
if [ "${ALERTS_WRAPPER}" -eq 0 ]; then
:
else
printf "SHELL PROXY-> is: %b%s%b\n" "${tmodSuccess}" "${1}" "${tmodReset}"
printf "SHELL PROXY (NONE)-> is: %b%s%b\n" "${tmodSuccess}" "${2}" "${tmodReset}"
fi
}
alert_proxy_no_proxy_value() {
if [ "${ALERTS_WRAPPER}" -eq 0 ]; then
:
else
printf "No no_proxy_value was provided, using the default: *no_proxy_value* \n"
fi
}
alert_proxy_password() {
if [ "${ALERTS_WRAPPER}" -eq 0 ]; then
:
else
printf "Proxy Password: \n"
fi
}
alert_proxy_password_masked() {
if [ "${ALERTS_WRAPPER}" -eq 0 ]; then
:
else
printf "Proxy Password Received as MASKED: ********************\n"
fi
}
alert_proxy_password_plain() {
if [ "${ALERTS_WRAPPER}" -eq 0 ]; then
:
else
printf "Proxy Password Received as PLAIN: %s\n" "${1}"
fi
}
alert_proxy_value() {
if [ "${ALERTS_WRAPPER}" -eq 0 ]; then
:
else
printf "%s=%s\n" "${1}" "${2}"
fi
}
## alert_skip_bit
alert_skip_bit() {
if [ "${SKIP_BIT_SET}" -eq 0 ]; then
printf "SKIP_BIT_SET is: %bOFF%b\n" "${tmodFailure}" "${tmodReset}"
else
printf "SKIP_BIT_SET is: %bON%b\n" "${tmodSuccess}" "${tmodReset}"
fi
}
## alert_system_details
alert_system_details() {
printf "%b%s%b: %b%s%b-> %b%s%b\n" "${tmodDisplay}" "${1}" "${tmodReset}" "${tmodLabelCustomNavigation}" "${2}" "${tmodReset}" "${tmodDisplayAttribute}" "${3}" "${tmodReset}"
}
## alert_vpn_*
alert_vpn_credentials_failed_for() {
if [ "${ALERTS_WRAPPER}" -eq 0 ]; then
:
else
printf "You need to provide valid default VPN credentials: %s could be passed, falling back to the default.\n" "${1}"
fi
}
alert_vpn_directory_invalid_for_instances() {
if [ "${ALERTS_WRAPPER}" -eq 0 ]; then
:
else
printf "FAILED-> %bNo valid VPN directory: %s could be passed, falling back to the default.%b\n" "${1}"
fi
}
alert_vpn_directory_invalid_for_slug() {
if [ "${ALERTS_WRAPPER}" -eq 0 ]; then
:
else
printf "FAILED-> %bNo valid VPN directory: %s could be passed, falling back to the default.%b\n" "${1}"
fi
}
alert_vpn_directory_not_found_for() {
if [ "${ALERTS_WRAPPER}" -eq 0 ]; then
:
else
printf "No valid VPN directory: %s could be passed, falling back to the default.\n" "${1}"
fi
}
alert_vpn_file_not_found_for() {
if [ "${ALERTS_WRAPPER}" -eq 0 ]; then
:
else
printf "No valid VPN file: %s could be passed, falling back to the default.\n" "${1}"
fi
}
###############################################################################
## Confirmation Tools
###############################################################################
confirm_view_directory(){
ls "${1}"
}
###############################################################################
## Open Tools
###############################################################################
open_location_x() {
"${CONFIGURATION_DEFAULT_OPEN}" "${1}"
}
###############################################################################
## trine_control_*
###############################################################################
trine_control_already_exists() {
if [ "${1}" = "directory" ]; then
printf "That directory exists in the tree: Attaching to the instance now.\n"
elif [ "${1}" = "file" ]; then
printf "That file already exists in the tree, aborting move... No file overwriting permitted.\n"
elif [ "${1}" = "instance" ]; then
printf "That instance already exists in the tree, aborting move... No instance overwriting permitted.\n"
else
printf "Already exists in the tree, aborting move... No overwriting permitted.\n"
fi
}
trine_control_attaching_to_tree() {
printf "Attaching: %s -> %s\n" "${1}" "${2}"
}
trine_control_building_heirarchy() {
printf "That instance exists, building %s into %s tree heirarchy.\n" "${1}" "${2}"
}
trine_control_glob() {
if [ "${1}" = "activated" ]; then
printf "<glob routine activated>\n"
elif [ "${1}" = "exhausted" ]; then
printf "<glob routine exhausted>\n"
else
printf "<glob*>\n"
fi
}
trine_control_instance_operations() {
printf "Total instance operations: %s\n" "${1}"
}
trine_control_item() {
printf "%b[ITEM]%b: %b%s%b\n" "${tmodLabelCustomSED}" "${tmodReset}" "${tmodLabelCustomNavigation}" "${1}" "${tmodReset}"
}
trine_control_item_credential() {
printf "%b[ITEM CREDENTIAL]%b: %b%s%b\n" "${tmodLabelCustomSED}" "${tmodReset}" "${tmodLabelCustomNavigation}" "${1}" "${tmodReset}"
}
trine_control_move() {
if [ "${1}" = "directory" ]; then
printf "Moving directory: %s -> %s\n" "${2}" "${3}"
elif [ "${1}" = "file" ]; then
printf "Moving file: %s -> %s\n" "${2}" "${3}"
else
printf "Moving instance: %s -> %s\n" "${2}" "${3}"
fi
}
trine_control_nth_zindex() {
if [ -z "${1}" ]; then
printf "nth_zindex-> Value: %b(EMPTY)%b\n" "${tmodFailure}" "${tmodReset}"
else
printf "nth_zindex-> Value: %b%s%b\n" "${tmodSuccess}" "${1}" "${tmodReset}"
fi
}
trine_control_reoperate() {
printf "Unidentified Instance: %s -> Setting the failure to reoperate slug.\n" "${1}"
}
trine_control_value_check() {
printf "Received TRINE control values-> %s: %s\n" "${1}" "${2}"
}
trine_control_value_expansion() {
printf "z_check is-> %b%s%b\n" "${tmodLabelCustomSED}" "${1}" "${tmodReset}"
if [ -n "${2}" ]; then
printf "nth_check is-> %b%s%b\n" "${tmodLabelCustomSED}" "${2}" "${tmodReset}"
else
printf "nth_check is-> %b(NOT SUPPLIED)%b\n" "${tmodWarning}" "${tmodReset}"
fi
}
trine_control_zindex() {
if [ -z "${1}" ]; then
printf "zindex-> Value: %b(EMPTY)%b\n" "${tmodFailure}" "${tmodReset}"
else
printf "zindex-> Value: %b%s%b\n" "${tmodSuccess}" "${1}" "${tmodReset}"
fi
}
###############################################################################
## Context
###############################################################################
## 1.) Anything that needs to be exactly defined, such as a
###############################################################################
## determine_*
###############################################################################
## wrapper: determine_mint_logic
determine_mint_logic() {
ValueNowS=$(echo "${3}" | sed 's/-R //g')
ValueNowZ=$(echo "${ValueNowS}" | awk -F'*' '{print "*"$2}' )
ValueNowZ_a=$(echo "${ValueNowS}" | awk -F'*' '{print $1}' )
#printf "ValueNowS-> %s\n" "${ValueNowS}"
#printf "ValueNowZ-> %s\n" "${ValueNowZ}"
#printf "ValueNowZ_a-> %s\n" "${ValueNowZ_a}"
## Check for variations, and if detected, alter the behavior
#printf "Modifying the Instance: %s\n" "${ValueNowS}"
if [ "${ValueNowS}" = "${ValueNowZ}" ] && [ -z "${ValueNowZ_a}" ]; then
#echo "X"
sudo "${1}" "${2}" ${ValueNowZ} ;
if [ "$?" -ge 1 ]; then
export FAILED_CHECK=1
else
:
fi
CWD="$(pwd)"
if [ "${1}" = "chmod" ]; then
alert_chmod "${1}" "${2}" "${CWD}/${ValueNowZ}"
elif [ "${1}" = "chown" ]; then
alert_chown "${1}" "${2}" "${CWD}/${ValueNowZ}"
else
echo "You didn't provide a valid option: chmod, and chown are available."
fi
elif [ "${3}" = "${ValueNowS}" ] && [ "${ValueNowS}" = "${ValueNowZ_a}" ]; then
#echo "a"
sudo "${1}" "${2}" "${3}" ;
if [ "$?" -ge 1 ]; then
export FAILED_CHECK=1
else
:
fi
if [ "${1}" = "chmod" ]; then
alert_chmod "${1}" "${2}" "${3}"
elif [ "${1}" = "chown" ]; then
alert_chown "${1}" "${2}" "${3}"
else
echo "You didn't provide a valid option: chmod, and chown are available."
fi
elif [ "${3}" != "${ValueNowS}" ] && [ "${ValueNowZ}" != "*" ]; then
#echo "b"
sudo "${1}" "${2}" -R "${ValueNowZ_a}"${ValueNowZ} ;
if [ "$?" -ge 1 ]; then
export FAILED_CHECK=1
else
:
fi
if [ "${1}" = "chmod" ]; then
alert_chmod "${1}" "${2}" "-R ${ValueNowZ_a}${ValueNowZ}"
elif [ "${1}" = "chown" ]; then
alert_chown "${1}" "${2}" "-R ${ValueNowZ_a}${ValueNowZ}"
else
echo "You didn't provide a valid option: chmod, and chown are available."
fi
elif [ "${ValueNowZ}" = "*" ] && [ "${ValueNowS}" != "${ValueNowZ_a}" ]; then
if [ "${3}" != "${ValueNowS}" ]; then
#echo "c"
sudo "${1}" "${2}" -R "${ValueNowZ_a}"${ValueNowZ} ;
if [ "$?" -ge 1 ]; then
export FAILED_CHECK=1
else
:
fi
if [ "${1}" = "chmod" ]; then
alert_chmod "${1}" "${2}" "-R ${ValueNowZ_a}${ValueNowZ}"
elif [ "${1}" = "chown" ]; then
alert_chown "${1}" "${2}" "-R ${ValueNowZ_a}${ValueNowZ}"
else
echo "You didn't provide a valid option: chmod, and chown are available."
fi
elif [ "${ValueNowZ}" != "*" ] && [ "${ValueNowS}" != "${ValueNowZ_a}" ]; then
#echo "d"
sudo "${1}" "${2}" "${ValueNowZ_a}"${ValueNowZ} ;
if [ "$?" -ge 1 ]; then
export FAILED_CHECK=1
else
:
fi
if [ "${1}" = "chmod" ]; then
alert_chmod "${1}" "${2}" "${ValueNowZ_a}${ValueNowZ}"
elif [ "${1}" = "chown" ]; then
alert_chown "${1}" "${2}" "${ValueNowZ_a}${ValueNowZ}"
else
echo "You didn't provide a valid option: chmod, and chown are available."
fi
else
sudo "${1}" "${2}" "${ValueNowZ_a}"${ValueNowZ} ;
if [ "$?" -ge 1 ]; then
export FAILED_CHECK=1
else
:
fi
if [ "${1}" = "chmod" ]; then
alert_chmod "${1}" "${2}" "${ValueNowZ_a}${ValueNowZ}"
elif [ "${1}" = "chown" ]; then
alert_chown "${1}" "${2}" "${ValueNowZ_a}${ValueNowZ}"
else
echo "You didn't provide a valid option: chmod, and chown are available."
fi
fi
elif [ "${ValueNowZ}" = "*" ] && [ "${ValueNowS}" = "${ValueNowZ_a}" ]; then
#echo "f"
sudo "${1}" "${2}" -R "${ValueNowS}" ;
if [ "$?" -ge 1 ]; then
export FAILED_CHECK=1
else
:
fi
if [ "${1}" = "chmod" ]; then
alert_chmod "${1}" "${2}" "-R ${ValueNowS}"
elif [ "${1}" = "chown" ]; then
alert_chown "${1}" "${2}" "-R ${ValueNowS}"
else
echo "You didn't provide a valid option: chmod, and chown are available."
fi
elif [ "${ValueNowZ}" != "*" ] && [ "${ValueNowS}" != "${ValueNowZ_a}" ]; then
#echo "g"
sudo "${1}" "${2}" "${ValueNowZ_a}"${ValueNowZ} ;
if [ "$?" -ge 1 ]; then
export FAILED_CHECK=1
else
:
fi
if [ "${1}" = "chmod" ]; then
alert_chmod "${1}" "${2}" "${ValueNowZ_a}${ValueNowZ}"
elif [ "${1}" = "chown" ]; then
alert_chown "${1}" "${2}" "${ValueNowZ_a}${ValueNowZ}"
else
echo "You didn't provide a valid option: chmod, and chown are available."
fi
else
echo "You didn't provide a valid option: chmod, and chown are available."
fi
}
## wrapper: determine_mint_logic
determine_lockeddown_mint_logic() {
ValueNowS=$(echo "${3}" | sed 's/-R //g')
ValueNowZ=$(echo "${ValueNowS}" | awk -F'*' '{print "*"$2}' )
ValueNowZ_a=$(echo "${ValueNowS}" | awk -F'*' '{print $1}' )
printf "ValueNowS-> %s\n" "${ValueNowS}"
printf "ValueNowZ-> %s\n" "${ValueNowZ}"
printf "ValueNowZ_a-> %s\n" "${ValueNowZ_a}"
## Check for variations, and if detected, alter the behavior
printf "Modifying the Instance: %s\n" "${ValueNowS}"
## If the passed directory exists, and the directory is not empty
if [ -n "${ValueNowS}" ]; then
if [ "${SKIP_BIT_SET}" = "0" ]; then
printf "Modifying the Instance: %s\n" "${ValueNowS}"
echo "confirm operations with 1, kill the operations with 0"
echo "terminate the program with d"
printf "Confirm operations?: \n" >&2
read -r confirmation_check
else
confirmation_check="1"
: # pass
fi
if [ "${SKIP_BIT_SET}" = "1" ] || [ "${confirmation_check}" = "1" ]; then
if [ "${ValueNowS}" = "${ValueNowZ}" ] && [ -z "${ValueNowZ_a}" ]; then
echo "X"
sudo "${1}" "${2}" ${ValueNowZ} ;
if [ "$?" -ge 1 ]; then
export FAILED_CHECK=1
else
:
fi
CWD="$(pwd)"
if [ "${1}" = "chmod" ]; then
alert_chmod "${1}" "${2}" "${CWD}/${ValueNowZ}"
elif [ "${1}" = "chown" ]; then
alert_chown "${1}" "${2}" "${CWD}/${ValueNowZ}"
else
echo "You didn't provide a valid option: chmod, and chown are available."
fi
elif [ "${3}" = "${ValueNowS}" ] && [ "${ValueNowS}" = "${ValueNowZ_a}" ]; then
echo "a"
sudo "${1}" "${2}" "${3}" ;
if [ "$?" -ge 1 ]; then
export FAILED_CHECK=1
else
:
fi
if [ "${1}" = "chmod" ]; then
alert_chmod "${1}" "${2}" "${3}"
elif [ "${1}" = "chown" ]; then
alert_chown "${1}" "${2}" "${3}"
else
echo "You didn't provide a valid option: chmod, and chown are available."
fi
elif [ "${3}" != "${ValueNowS}" ] && [ "${ValueNowZ}" != "*" ]; then
echo "b"
sudo "${1}" "${2}" -R "${ValueNowZ_a}"${ValueNowZ} ;
if [ "$?" -ge 1 ]; then
export FAILED_CHECK=1
else
:
fi
if [ "${1}" = "chmod" ]; then
alert_chmod "${1}" "${2}" "-R ${ValueNowZ_a}${ValueNowZ}"
elif [ "${1}" = "chown" ]; then
alert_chown "${1}" "${2}" "-R ${ValueNowZ_a}${ValueNowZ}"
else
echo "You didn't provide a valid option: chmod, and chown are available."
fi
elif [ "${ValueNowZ}" = "*" ] && [ "${ValueNowS}" != "${ValueNowZ_a}" ]; then
if [ "${3}" != "${ValueNowS}" ]; then
echo "c"
sudo "${1}" "${2}" -R "${ValueNowZ_a}"${ValueNowZ} ;
if [ "$?" -ge 1 ]; then
export FAILED_CHECK=1
else
:
fi
if [ "${1}" = "chmod" ]; then
alert_chmod "${1}" "${2}" "-R ${ValueNowZ_a}${ValueNowZ}"
elif [ "${1}" = "chown" ]; then
alert_chown "${1}" "${2}" "-R ${ValueNowZ_a}${ValueNowZ}"
else
echo "You didn't provide a valid option: chmod, and chown are available."
fi
elif [ "${ValueNowZ}" != "*" ] && [ "${ValueNowS}" != "${ValueNowZ_a}" ]; then
echo "d"
sudo "${1}" "${2}" "${ValueNowZ_a}"${ValueNowZ} ;
if [ "$?" -ge 1 ]; then
export FAILED_CHECK=1
else
:
fi
if [ "${1}" = "chmod" ]; then
alert_chmod "${1}" "${2}" "${ValueNowZ_a}${ValueNowZ}"
elif [ "${1}" = "chown" ]; then
alert_chown "${1}" "${2}" "${ValueNowZ_a}${ValueNowZ}"
else
echo "You didn't provide a valid option: chmod, and chown are available."
fi
else
sudo "${1}" "${2}" "${ValueNowZ_a}"${ValueNowZ} ;
if [ "$?" -ge 1 ]; then
export FAILED_CHECK=1
else
:
fi
if [ "${1}" = "chmod" ]; then
alert_chmod "${1}" "${2}" "${ValueNowZ_a}${ValueNowZ}"
elif [ "${1}" = "chown" ]; then
alert_chown "${1}" "${2}" "${ValueNowZ_a}${ValueNowZ}"
else
echo "You didn't provide a valid option: chmod, and chown are available."
fi
fi
elif [ "${ValueNowZ}" = "*" ] && [ "${ValueNowS}" = "${ValueNowZ_a}" ]; then
echo "f"
sudo "${1}" "${2}" -R "${ValueNowS}" ;
if [ "$?" -ge 1 ]; then
export FAILED_CHECK=1
else
:
fi
if [ "${1}" = "chmod" ]; then
alert_chmod "${1}" "${2}" "-R ${ValueNowS}"
elif [ "${1}" = "chown" ]; then
alert_chown "${1}" "${2}" "-R ${ValueNowS}"
else
echo "You didn't provide a valid option: chmod, and chown are available."
fi
elif [ "${ValueNowZ}" != "*" ] && [ "${ValueNowS}" != "${ValueNowZ_a}" ]; then
echo "g"
sudo "${1}" "${2}" "${ValueNowZ_a}"${ValueNowZ} ;
if [ "$?" -ge 1 ]; then
export FAILED_CHECK=1
else
:
fi
if [ "${1}" = "chmod" ]; then
alert_chmod "${1}" "${2}" "${ValueNowZ_a}${ValueNowZ}"
elif [ "${1}" = "chown" ]; then
alert_chown "${1}" "${2}" "${ValueNowZ_a}${ValueNowZ}"
else
echo "You didn't provide a valid option: chmod, and chown are available."
fi
else
echo "You didn't provide a valid option: chmod, and chown are available."
fi
elif [ "${confirmation_check}" = "d" ]; then
echo "You destroyed the program: Exiting now..."
exit 0 # DESTROYED
else
alert_destruction_key_activated
fi
fi
}
## wrapper: determine_mint_logic
determine_protected_mint_logic() {
ValueNowS=$(echo "${3}" | sed 's/-R //g')
ValueNowZ=$(echo "${ValueNowS}" | awk -F'*' '{print "*"$2}' )
ValueNowZ_a=$(echo "${ValueNowS}" | awk -F'*' '{print $1}' )
#printf "ValueNowS-> %s\n" "${ValueNowS}"
#printf "ValueNowZ-> %s\n" "${ValueNowZ}"
#printf "ValueNowZ_a-> %s\n" "${ValueNowZ_a}"
## Check for variations, and if detected, alter the behavior
#printf "Modifying the Instance: %s\n" "${ValueNowS}"
if [ -n "${ValueNowS}" ]; then
if [ "${ValueNowS}" = "${ValueNowZ}" ] && [ -z "${ValueNowZ_a}" ]; then
#echo "X"
sudo "${1}" "${2}" ${ValueNowZ} ;
if [ "$?" -ge 1 ]; then
export FAILED_CHECK=1
else
:
fi
CWD="$(pwd)"
if [ "${1}" = "chmod" ]; then
alert_chmod "${1}" "${2}" "${CWD}/${ValueNowZ}"
elif [ "${1}" = "chown" ]; then
alert_chown "${1}" "${2}" "${CWD}/${ValueNowZ}"
else
echo "You didn't provide a valid option: chmod, and chown are available."
fi
elif [ "${3}" = "${ValueNowS}" ] && [ "${ValueNowS}" = "${ValueNowZ_a}" ]; then
#echo "a"
sudo "${1}" "${2}" "${3}" ;
if [ "$?" -ge 1 ]; then
export FAILED_CHECK=1
else
:
fi
if [ "${1}" = "chmod" ]; then
alert_chmod "${1}" "${2}" "${3}"
elif [ "${1}" = "chown" ]; then
alert_chown "${1}" "${2}" "${3}"
else
echo "You didn't provide a valid option: chmod, and chown are available."
fi
elif [ "${3}" != "${ValueNowS}" ] && [ "${ValueNowZ}" != "*" ]; then
#echo "b"
sudo "${1}" "${2}" -R "${ValueNowZ_a}"${ValueNowZ} ;
if [ "$?" -ge 1 ]; then
export FAILED_CHECK=1
else
:
fi
if [ "${1}" = "chmod" ]; then
alert_chmod "${1}" "${2}" "-R ${ValueNowZ_a}${ValueNowZ}"
elif [ "${1}" = "chown" ]; then
alert_chown "${1}" "${2}" "-R ${ValueNowZ_a}${ValueNowZ}"
else
echo "You didn't provide a valid option: chmod, and chown are available."
fi
elif [ "${ValueNowZ}" = "*" ] && [ "${ValueNowS}" != "${ValueNowZ_a}" ]; then
if [ "${3}" != "${ValueNowS}" ]; then
#echo "c"
sudo "${1}" "${2}" -R "${ValueNowZ_a}"${ValueNowZ} ;
if [ "$?" -ge 1 ]; then
export FAILED_CHECK=1
else
:
fi
if [ "${1}" = "chmod" ]; then
alert_chmod "${1}" "${2}" "-R ${ValueNowZ_a}${ValueNowZ}"
elif [ "${1}" = "chown" ]; then
alert_chown "${1}" "${2}" "-R ${ValueNowZ_a}${ValueNowZ}"
else
echo "You didn't provide a valid option: chmod, and chown are available."
fi
elif [ "${ValueNowZ}" != "*" ] && [ "${ValueNowS}" != "${ValueNowZ_a}" ]; then
#echo "d"
sudo "${1}" "${2}" "${ValueNowZ_a}"${ValueNowZ} ;
if [ "$?" -ge 1 ]; then
export FAILED_CHECK=1
else
:
fi
if [ "${1}" = "chmod" ]; then
alert_chmod "${1}" "${2}" "${ValueNowZ_a}${ValueNowZ}"
elif [ "${1}" = "chown" ]; then
alert_chown "${1}" "${2}" "${ValueNowZ_a}${ValueNowZ}"
else
echo "You didn't provide a valid option: chmod, and chown are available."
fi
else
sudo "${1}" "${2}" "${ValueNowZ_a}"${ValueNowZ} ;
if [ "$?" -ge 1 ]; then
export FAILED_CHECK=1
else
:
fi
if [ "${1}" = "chmod" ]; then
alert_chmod "${1}" "${2}" "${ValueNowZ_a}${ValueNowZ}"
elif [ "${1}" = "chown" ]; then
alert_chown "${1}" "${2}" "${ValueNowZ_a}${ValueNowZ}"
else
echo "You didn't provide a valid option: chmod, and chown are available."
fi
fi
elif [ "${ValueNowZ}" = "*" ] && [ "${ValueNowS}" = "${ValueNowZ_a}" ]; then
#echo "f"
sudo "${1}" "${2}" -R "${ValueNowS}" ;
if [ "$?" -ge 1 ]; then
export FAILED_CHECK=1
else
:
fi
if [ "${1}" = "chmod" ]; then
alert_chmod "${1}" "${2}" "-R ${ValueNowS}"
elif [ "${1}" = "chown" ]; then
alert_chown "${1}" "${2}" "-R ${ValueNowS}"
else
echo "You didn't provide a valid option: chmod, and chown are available."
fi
elif [ "${ValueNowZ}" != "*" ] && [ "${ValueNowS}" != "${ValueNowZ_a}" ]; then
#echo "g"
sudo "${1}" "${2}" "${ValueNowZ_a}"${ValueNowZ} ;
if [ "$?" -ge 1 ]; then
export FAILED_CHECK=1
else
:
fi
if [ "${1}" = "chmod" ]; then
alert_chmod "${1}" "${2}" "${ValueNowZ_a}${ValueNowZ}"
elif [ "${1}" = "chown" ]; then
alert_chown "${1}" "${2}" "${ValueNowZ_a}${ValueNowZ}"
else
echo "You didn't provide a valid option: chmod, and chown are available."
fi
else
echo "You didn't provide a valid option: chmod, and chown are available."
fi
else
printf "-> %b %s was not provided%b\n" "${tmodWarning}" "${ValueNowS}" "${tmodReset}"
fi
}
###############################################################################
## extend_*
###############################################################################
## wrapper: extend_mint_operations
extend_mint_operations() {
## sudo <PROPERTY> <PATH> -type <INSTANCE_TYPE> -exec <PROPERTY_MODIFIER> <PROPERTY_SPEC_CHANGE> {} \;
sudo "${1}" "${2}" -type "${3}" -exec "${4}" "${5}" {} \;
alert_find_and_modify "${1}" "${2}" "${3}" "${4}" "${5}"
}
## wrapper: extend_mint_operations
extend_lockeddown_mint_operations() {
## If the passed directory exists, and the directory is not empty
if [ -d "${2}" ] && [ -n "${2}" ]; then
if [ "${SKIP_BIT_SET}" = "0" ]; then
echo "Modifying the instance: ${3}"
echo "confirm operations with 1, kill the operations with 0"
echo "terminate the program with d"
printf "Confirm operations?: \n" >&2
read -r confirmation_check
else
confirmation_check="1"
: # pass
fi
if [ "${SKIP_BIT_SET}" = "1" ] || [ "${confirmation_check}" = "1" ]; then
## sudo <PROPERTY> <PATH> -type <INSTANCE_TYPE> -exec <PROPERTY_MODIFIER> <PROPERTY_SPEC_CHANGE> {} \;
sudo "${1}" "${2}" -type "${3}" -exec "${4}" "${5}" {} \;
alert_find_and_modify_lockeddown "${1}" "${2}" "${3}" "${4}" "${5}"
elif [ "${confirmation_check}" = "d" ]; then
echo "You destroyed the program: Exiting now..."
exit 0 # DESTROYED
else
alert_destruction_key_activated
fi
fi
}
## wrapper: extend_mint_operations
extend_protected_mint_operations() {
## If the passed directory exists, and the directory is not empty
if [ -d "${2}" ] && [ -n "${2}" ]; then
## sudo <PROPERTY> <PATH> -type <INSTANCE_TYPE> -exec <PROPERTY_MODIFIER> <PROPERTY_SPEC_CHANGE> {} \;
sudo "${1}" "${2}" -type "${3}" -exec "${4}" "${5}" {} \;
alert_find_and_modify_protected "${1}" "${2}" "${3}" "${4}" "${5}"
else
alert_path_not_located "${2}"
fi
}
###############################################################################
## modify_*
###############################################################################
## wrapper: modify property
modify_instance_property() {
## chattr
if [ "${2}" = "-i" ]; then
sudo "${1}" "${2}" "${3}" ;
alert_instance_not_immutable "${3}"
elif [ "${2}" = "+i" ]; then
sudo "${1}" "${2}" "${3}" ;
alert_instance_now_immutable "${3}"
else
alert_invalid_property "${3}"
fi
}
## wrapper: modify property
modify_lockeddown_instance_property() {
## If the passed directory exists, and the directory is not empty
if [ -d "${3}" ] && [ -n "${3}" ]; then
if [ "${SKIP_BIT_SET}" = "0" ]; then
printf "Modifying the instance: %s\n" "${3}"
echo "confirm operations with 1, kill the operations with 0"
echo "terminate the program with d"
printf "Confirm operations?: \n" >&2
read -r confirmation_check
else
confirmation_check="1"
: # pass
fi
if [ "${SKIP_BIT_SET}" = "1" ] || [ "${confirmation_check}" = "1" ]; then
## chattr
if [ "${2}" = "-i" ]; then
sudo "${1}" "${2}" "${3}" ;
alert_instance_not_immutable_lockeddown "${3}"
elif [ "${2}" = "+i" ]; then
sudo "${1}" "${2}" "${3}" ;
alert_instance_now_immutable_lockeddown "${3}"
else
alert_invalid_property "${3}"
fi
elif [ "${confirmation_check}" = "d" ]; then
echo "You destroyed the program: Exiting now..."
exit 0 # DESTROYED
else
alert_destruction_key_activated
fi
else
alert_path_not_located "${3}"
fi
}
## wrapper: modify property
modify_protected_instance_property() {
## If the passed directory exists, and the directory is not empty
if [ -d "${3}" ] && [ -n "${3}" ]; then
## chattr
if [ "${2}" = "-i" ]; then
sudo "${1}" "${2}" "${3}" ;
alert_instance_not_immutable_protected "${3}"
elif [ "${2}" = "+i" ]; then
sudo "${1}" "${2}" "${3}" ;
alert_instance_now_immutable_protected "${3}"
else
alert_invalid_property "${3}"
fi
else
alert_path_not_located "${3}"
fi
}
###############################################################################
## perform_*
###############################################################################
## +++ Scoped standards available
## To avoid having to use exec - a "${EXECUTION_SLUG_DUGOUT}" should be used
## to anchor execution based scripts in the natural root of the file system
## at the standard location /
## 1.) perform_routine_*
## Any activity that provides a summary system routine through a script
## 2.) perform_mint_*
## Any general mint related activity focused on fixing ownership of files
## and changing execution variables within a file system
## 3.) perform_mint_instance_*
## 4.) perform_mint_operator_*
## 5.) perform_mint_protected_*
## 6.) perform_mint_novastore_*
## 7.) perform_mint_server_*
## 8.) perform_mint_special_*
###############################################################################
## perform_routine_*
###############################################################################
## backup_all
perform_routine_backup_all() {
exec "${PATH_MAINTAINME}${SLUG_MAINTAINME_perform}/${ENDPOINT_PERFORM_BACKUP_ROUTINES}"
}
## configure_env_corehost
perform_routine_configure_env_corehost() {
exec "${PATH_PROTECTED_CONFIGURE}${ENDPOINT_CONFIGURE_ENV_COREHOST}"
}
## configure_env_jupyter_admin
perform_routine_configure_env_jupyter_admin() {
exec "${PATH_PROTECTED_CONFIGURE}${ENDPOINT_CONFIGURE_ENV_JUPYTER_ADMIN}"
}
## configure_env_jupyter_standard
perform_routine_configure_env_jupyter_standard() {
exec "${PATH_PROTECTED_CONFIGURE}${ENDPOINT_CONFIGURE_ENV_JUPYTER_STANDARD}"
}
## configure_env_pgadmin4
perform_routine_configure_env_pgadmin4() {
exec "${PATH_PROTECTED_CONFIGURE}${ENDPOINT_CONFIGURE_ENV_PGADMIN4}"
}
## configure_env_trine
perform_routine_configure_env_trine() {
exec "${PATH_PROTECTED_CONFIGURE}${ENDPOINT_CONFIGURE_ENV_TRINE}"
}
## routine_cron_edit
perform_routine_cron_edit() {
"${EXECUTION_SLUG_DUGOUT}${PATH_CONFIGURE}${ENDPOINT_CONFIGURE_CRON}" "${1}"
}
## display_operator_emblem
perform_routine_display_operator_emblem() {
exec "${PATH_MAINTAINME}${SLUG_MAINTAINME_display}/${ENDPOINT_DISPLAY_OPERATOR}"
}
## screen_config
perform_routine_screen_config() {
exec "${PATH_MAINTAINME}${SLUG_MAINTAINME_configure}/${ENDPOINT_CONFIGURE_MONITORS}"
}
## build or mangle the network with the zenwire program to replace network manager
perform_routine_zenwire_network_mangle() {
## Execution hooks are used to destroy the network routine
"${EXECUTION_SLUG_DUGOUT}${PATH_STATE_MODIFIER}/destroy_network.sh" ;
}
###############################################################################
## Linker scripts do not need an exeuction hook
###############################################################################
perform_routine_zenwire_network_up() {
## Execution hooks are used to build the network routine
"${EXECUTION_SLUG_DUGOUT}${PATH_STATE_MODIFIER}/provide_link_up_hook.sh"
## which will call in provide_execution_hook.sh and build_network.sh
}
###############################################################################
## perform_mint_*
###############################################################################
## perform_mint_fs
perform_mint_fs() {
exec "${PATH_MINTER}/${ENDPOINT_MINTER_FILESYSTEM}"
}
## perform_mint_shared
perform_mint_shared() {
exec "${PATH_MINTER}/${ENDPOINT_MINTER_SHARED}"
}
###############################################################################
## _mint_instance_*
###############################################################################
## perform_mint_instance_core
perform_mint_instance_core() {
exec "${PATH_MINTER_INSTANCE}${ENDPOINT_MINTER_INSTANCE_CORE}"
}
## perform_mint_instance_corehost
perform_mint_instance_corehost() {
exec "${PATH_MINTER_INSTANCE}${ENDPOINT_MINTER_INSTANCE_COREHOST}"
}
## perform_mint_instance_pgadmin4
perform_mint_instance_pgadmin4() {
exec "${PATH_MINTER_INSTANCE}${ENDPOINT_MINTER_INSTANCE_PGADMIN4}"
}
## perform_mint_instance_trine
perform_mint_instance_trine() {
exec "${PATH_MINTER_INSTANCE}${ENDPOINT_MINTER_INSTANCE_TRINE}"
}
###############################################################################
## mint_operator_*
###############################################################################
## user1
perform_mint_operator_user1() {
exec "${PATH_MINTER_PROTECTED}${ENDPOINT_MINTER_OPERATOR_USER1}"
}
###############################################################################
## mint_novastore_*
###############################################################################
## mint_novastore_blockchain
perform_mint_novastore_blockchain() {
exec "${PATH_MINTER_NOVASTORE}${ENDPOINT_MINTER_NOVASTORE_BLOCKCHAIN}"
}
## mint_novastore_dugout
perform_mint_novastore_dugout() {
exec "${PATH_MINTER_NOVASTORE}${ENDPOINT_MINTER_NOVASTORE_DUGOUT}"
}
## mint_novastore_enclave
perform_mint_novastore_enclave() {
exec "${PATH_MINTER_NOVASTORE}${ENDPOINT_MINTER_NOVASTORE_ENCLAVE}"
}
## mint_novastore_keys
perform_mint_novastore_keys() {
exec "${PATH_MINTER_NOVASTORE}${ENDPOINT_MINTER_NOVASTORE_KEYS}"
}
## mint_novastore_log
perform_mint_novastore_log() {
exec "${PATH_MINTER_NOVASTORE}${ENDPOINT_MINTER_NOVASTORE_LOG}"
}
## mint_novastore_maintainme
perform_mint_novastore_maintainme() {
exec "${PATH_MINTER_NOVASTORE}${ENDPOINT_MINTER_NOVASTORE_MAINTAINME}"
}
## mint_novastore_media
perform_mint_novastore_media() {
exec "${PATH_MINTER_NOVASTORE}${ENDPOINT_MINTER_NOVASTORE_MEDIA}"
}
## mint_novastore
perform_mint_novastore() {
exec "${PATH_MINTER_NOVASTORE}${ENDPOINT_MINTER_NOVASTORE}"
}
## mint_novastore_programs
perform_mint_novastore_programs() {
exec "${PATH_MINTER_NOVASTORE}${ENDPOINT_MINTER_NOVASTORE_PROGRAMS}"
}
###############################################################################
## perform_mint_protected_*
###############################################################################
## mint_protected_archive
perform_mint_protected_archive() {
exec "${PATH_MINTER_PROTECTED}${ENDPOINT_MINTER_PROTECTED_ARCHIVE}"
}
## mint_protected_audio
perform_mint_protected_audio() {
exec "${PATH_MINTER_PROTECTED}${ENDPOINT_MINTER_PROTECTED_AUDIO}"
}
## mint_protected_adult
perform_mint_protected_adult() {
exec "${PATH_MINTER_PROTECTED}${ENDPOINT_MINTER_PROTECTED_ADULT}"
}
## mint_protected_clips
perform_mint_protected_clips() {
exec "${PATH_MINTER_PROTECTED}${ENDPOINT_MINTER_PROTECTED_CLIPS}"
}
## mint_protected_fashion
perform_mint_protected_fashion() {
exec "${PATH_MINTER_PROTECTED}${ENDPOINT_MINTER_PROTECTED_FASHION}"
}
## mint_protected_music
perform_mint_protected_music() {
exec "${PATH_MINTER_PROTECTED}${ENDPOINT_MINTER_PROTECTED_MUSIC}"
}
## mint_protected_ore
perform_mint_protected_ore() {
exec "${PATH_MINTER_PROTECTED}${ENDPOINT_MINTER_PROTECTED_ORE}"
}
## mint_protected_phones
perform_mint_protected_phones() {
exec "${PATH_MINTER_PROTECTED}${ENDPOINT_MINTER_PROTECTED_PHONES}"
}
## mint_protected_pictures
perform_mint_protected_pictures() {
exec "${PATH_MINTER_PROTECTED}${ENDPOINT_MINTER_PROTECTED_PICTURES}"
}
## mint_protected_user_key_credential
perform_mint_protected_user_key_credential() {
exec "${PATH_MINTER_PROTECTED}${ENDPOINT_PROTECTED_MINTER_USER_KEY_CREDENTIAL}"
}
## mint_protected_videos
perform_mint_protected_videos() {
exec "${PATH_MINTER_PROTECTED}${ENDPOINT_MINTER_PROTECTED_VIDEOS}"
}
## mint_protected_voidzone
perform_mint_protected_voidzone() {
exec "${PATH_MINTER_PROTECTED}${ENDPOINT_MINTER_PROTECTED_VOIDZONE}"
}
## mint_protected_webserver
perform_mint_protected_webserver() {
exec "${PATH_MINTER_PROTECTED}${ENDPOINT_MINTER_PROTECTED_WEBSERVER}"
}
###############################################################################
## perform_mint_server_*
###############################################################################
## mint_server_local
perform_mint_server_local() {
exec "${PATH_MINTER_SERVER}${ENDPOINT_MINTER_SERVER_LOCAL}"
}
###############################################################################
## perform_mint_special_*
###############################################################################
## mint_special_pgadmin4
perform_mint_special_pgadmin4() {
exec "${PATH_MINTER_SPECIAL}${ENDPOINT_MINTER_SPECIAL_PGADMIN4}"
}
###############################################################################
## perform custom execution macros
###############################################################################
## reseed
perform_routine_reseed() {
# 1.) Rourtines inherit a navigated path
# 2.) Routines take a COMMAND_SEQUENCE
# 3.) Routines inherit a execution script
perform_tree_walk_protected "${PATH_RESEED_DIRECTORY}"
. "${PATH_VEA_TRINE}"
python "${ENDPOINT_RESEED_FILE}" --reseed=a
}
###############################################################################
## perform_* general
###############################################################################
## _creation_*
## pcd
## [X] Working
## [X] Compliant
perform_creation_directory() {
## Counter
counter_operations=0
## Control Stack
IFS=","
set -- "$@"
z_check="${1}"
nth_check="${2}"
if [ "${TRINE_CONTROL_VERBOSE}" == "1" ] || [ "${TRINE_CONTROL_VERBOSE}" -eq 1 ]; then
trine_control_value_check "pcd" "$*"
trine_control_value_expansion "${1}" "${2}"
else
:
fi
if [ -n "${z_check}" ] && [ -n "${nth_check}" ]; then
if [ "${TRINE_CONTROL_VERBOSE}" == "1" ] || [ "${TRINE_CONTROL_VERBOSE}" -eq 1 ]; then
trine_control_glob "activated"
else
:
fi
## Currently activating a glob
glob_construct() {
if [ -z "${1}" ]; then
if [ "${TRINE_CONTROL_VERBOSE}" == "1" ] || [ "${TRINE_CONTROL_VERBOSE}" -eq 1 ]; then
trine_control_glob "exhausted"
else
:
fi
else
if [ "${TRINE_CONTROL_VERBOSE}" == "1" ] || [ "${TRINE_CONTROL_VERBOSE}" -eq 1 ]; then
trine_control_item "${1}"
else
:
fi
## Branch if a glob is detected
# ## Skip any special operators
if [ -d "${1}" ]; then
printf "Failed-> Directory already exists: %s\n" "${1}"
else
mkdir "${1}" ;
chown "${DIRECTORY_CREATION_OWNER_GENERIC}" "${1}" ;
chmod "${DIRECTORY_CREATION_PERMISSIONS_GENERIC}" "${1}" ;
if [ "$?" -ge 1 ]; then
printf "<c:::d> %bFAILED-> %s%b\n" "${tmodFailure}" "${1}" "${tmodReset}"
else
printf "<c:::d> %b%s%b\n" "${tmodSuccess}" "${1}" "${tmodReset}"
fi
fi
fi
}
while
glob_construct "$@"
counter_operations=$((counter_operations+1))
shift 1
do
: ;
done
if [ "${TRINE_CONTROL_VERBOSE}" == "1" ] || [ "${TRINE_CONTROL_VERBOSE}" -eq 1 ]; then
trine_control_instance_operations "${counter_operations}"
else
:
fi
elif [ -d "${1}" ]; then
echo "That directory already exists."
elif [ -z "${1}" ]; then
echo "You haven't supplied a directory to create."
else
if [ "${VERBOSE_CONTEXT}" -eq 0 ]; then
:
else
printf "Creating a directory: %s\n" "${1}"
fi
mkdir "${1}" ;
chown "${DIRECTORY_CREATION_OWNER_GENERIC}" "${1}" ;
chmod "${DIRECTORY_CREATION_PERMISSIONS_GENERIC}" "${1}" ;
if [ "$?" -ge 1 ]; then
printf "<c:::d> %bFAILED-> %s%b\n" "${tmodFailure}" "${1}" "${tmodReset}"
else
printf "<c:::d> %b%s%b\n" "${tmodSuccess}" "${1}" "${tmodReset}"
fi
fi
}
## pcf
## [X] Working
## [X] Compliant
perform_creation_file() {
## Counter
counter_operations=0
## Control Stack
IFS=","
set -- "$@"
z_check="${1}"
nth_check="${2}"
if [ "${TRINE_CONTROL_VERBOSE}" == "1" ] || [ "${TRINE_CONTROL_VERBOSE}" -eq 1 ]; then
trine_control_value_check "pcf" "$*"
trine_control_value_expansion "${1}" "${2}"
else
:
fi
if [ -n "${z_check}" ] && [ -n "${nth_check}" ]; then
if [ "${TRINE_CONTROL_VERBOSE}" == "1" ] || [ "${TRINE_CONTROL_VERBOSE}" -eq 1 ]; then
trine_control_glob "activated"
else
:
fi
## Currently activating a glob
glob_construct() {
if [ -z "${1}" ]; then
if [ "${TRINE_CONTROL_VERBOSE}" == "1" ] || [ "${TRINE_CONTROL_VERBOSE}" -eq 1 ]; then
trine_control_glob "exhausted"
else
:
fi
else
if [ "${TRINE_CONTROL_VERBOSE}" == "1" ] || [ "${TRINE_CONTROL_VERBOSE}" -eq 1 ]; then
trine_control_item "${1}"
else
:
fi
## Branch if a glob is detected
# ## Skip any special operators
if [ -d "${1}" ]; then
printf "Failed-> File already exists: %s\n" "${1}"
else
touch "${1}" ;
chown "${FILE_CREATION_OWNER_GENERIC}" "${1}" ;
chmod "${FILE_CREATION_PERMISSIONS_GENERIC}" "${1}" ;
if [ "$?" -ge 1 ]; then
printf "<c:::f> %bFAILED-> %s%b\n" "${tmodFailure}" "${1}" "${tmodReset}"
else
printf "<c:::f> %b%s%b\n" "${tmodSuccess}" "${1}" "${tmodReset}"
fi
fi
fi
}
while
glob_construct "$@"
counter_operations=$((counter_operations+1))
shift 1
do
: ;
done
if [ "${TRINE_CONTROL_VERBOSE}" == "1" ] || [ "${TRINE_CONTROL_VERBOSE}" -eq 1 ]; then
trine_control_instance_operations "${counter_operations}"
else
:
fi
elif [ -f "${1}" ]; then
echo "That file already exists."
elif [ -z "${1}" ]; then
echo "You haven't supplied a file to create."
else
if [ "${VERBOSE_CONTEXT}" -eq 0 ]; then
:
else
printf "Creating a directory: %s\n" "${1}"
fi
touch "${1}" ;
chown "${FILE_CREATION_OWNER_GENERIC}" "${1}" ;
chmod "${FILE_CREATION_PERMISSIONS_GENERIC}" "${1}" ;
if [ "$?" -ge 1 ]; then
printf "<c:::f> %bFAILED-> %s%b\n" "${tmodFailure}" "${1}" "${tmodReset}"
else
printf "<c:::f> %b%s%b\n" "${tmodSuccess}" "${1}" "${tmodReset}"
fi
fi
}
## _move_*
## pmg
## [x] Working
## [x] Compliant
## USE-> pmg {spaced\ directory\ move,heyyes,hey.txt,spaced\ file\ \ move.txt} c
perform_move_generic() {
## Counter
counter_operations=0
## Control Stack
IFS=","
set -- "$@"
zindex() {
zindex=$#
}
zindex "$@"
if [ "${TRINE_CONTROL_VERBOSE}" == "1" ] || [ "${TRINE_CONTROL_VERBOSE}" -eq 1 ]; then
trine_control_zindex "${zindex}"
else
:
fi
nth_zindex="${zindex}"
nth_zindex_value=$(eval "echo "\$$nth_zindex"") #"${!nth_zindex}" (BASH)
if [ "${TRINE_CONTROL_VERBOSE}" == "1" ] || [ "${TRINE_CONTROL_VERBOSE}" -eq 1 ]; then
trine_control_nth_zindex "${nth_zindex_value}"
else
:
fi
z_check="${1}"
nth_check="${2}"
if [ "${TRINE_CONTROL_VERBOSE}" == "1" ] || [ "${TRINE_CONTROL_VERBOSE}" -eq 1 ]; then
trine_control_value_check "pmg" "$*"
trine_control_value_expansion "${1}" "${2}"
else
:
fi
glob_construct() {
UNION="${nth_zindex_value}/${1}"
imaginary_zindex() {
imaginary_zindex=$#
}
imaginary_zindex "$@"
printf "imaginary_z_index is-> %s\n" "${imaginary_zindex}"
if [ "${imaginary_zindex}" = "1" ]; then
if [ "${TRINE_CONTROL_VERBOSE}" == "1" ] || [ "${TRINE_CONTROL_VERBOSE}" -eq 1 ]; then
trine_control_glob "exhausted"
else
:
fi
else
if [ "${TRINE_CONTROL_VERBOSE}" == "1" ] || [ "${TRINE_CONTROL_VERBOSE}" -eq 1 ]; then
trine_control_item "${1}"
else
:
fi
if [ -d "${nth_zindex_value}" ] && [ -f "${1}" ]; then
if [ "${TRINE_CONTROL_VERBOSE}" == "1" ] || [ "${TRINE_CONTROL_VERBOSE}" -eq 1 ]; then
trine_control_building_heirarchy "{1}" "${nth_zindex_value}"
else
:
fi
if [ -f "${UNION}" ]; then
if [ "${TRINE_CONTROL_VERBOSE}" == "1" ] || [ "${TRINE_CONTROL_VERBOSE}" -eq 1 ]; then
trine_control_already_exists "file"
else
:
fi
else
if [ "${VERBOSE_CONTEXT}" -eq 0 ]; then
:
else
if [ "${TRINE_CONTROL_VERBOSE}" == "1" ] || [ "${TRINE_CONTROL_VERBOSE}" -eq 1 ]; then
trine_control_attaching_to_tree "${1}" "${nth_zindex_value}"
else
:
fi
fi
mv "${1}" "${nth_zindex_value}/"
if [ "$?" -ge 1 ]; then
printf "<m:f:<T>:d> %bFAILED-> %s%b -> %b%s%b\n" "${tmodFailure}" "${1}" "${tmodReset}" "${tmodLabelCustomSED}" "${nth_zindex_value}" "${tmodReset}"
else
printf "<m:f:<T>:d> %b%s%b -> %b%s%b\n" "${tmodSuccess}" "${1}" "${tmodReset}" "${tmodLabelCustomSED}" "${nth_zindex_value}" "${tmodReset}"
fi
fi
elif [ -d "${nth_zindex_value}" ] && [ -d "{$1}" ]; then
if [ "${VERBOSE_CONTEXT}" -eq 0 ]; then
:
else
printf "Attaching: %s -> %s" "${1}" "${nth_zindex_value}"
fi
mv "${1}" "${nth_zindex_value}/"
if [ "$?" -ge 1 ]; then
printf "<m::<T>:d> %bFAILED-> %s%b -> %b%s%b\n" "${tmodFailure}" "${1}" "${tmodReset}" "${tmodLabelCustomSED}" "${nth_zindex_value}" "${tmodReset}"
else
printf "<m::<T>:d> %b%s%b -> %b%s%b\n" "${tmodSuccess}" "${1}" "${tmodReset}" "${tmodLabelCustomSED}" "${nth_zindex_value}" "${tmodReset}"
fi
elif [ -f "${nth_zindex_value}" ] && [ -f "${1}" ]; then
printf "Failed-> Can't Move, File already exists: %s\n" "${nth_zindex_value}"
else
if [ -f "${1}" ]; then
if [ "${VERBOSE_CONTEXT}" -eq 0 ]; then
:
else
printf "Moving file: %s -> %s\n" "${1}" "${nth_zindex_value}"
fi
mv "${1}" "${nth_zindex_value}"
if [ "$?" -ge 1 ]; then
printf "<m:::f> %bFAILED-> %s%b -> %b%s%b\n" "${tmodFailure}" "${1}" "${tmodReset}" "${tmodLabelCustomSED}" "${2}" "${tmodReset}"
else
printf "<m:::f> %b%s%b -> %b%s%b\n" "${tmodSuccess}" "${1}" "${tmodReset}" "${tmodLabelCustomSED}" "${2}" "${tmodReset}"
fi
elif [ -d "${1}" ]; then
if [ "${VERBOSE_CONTEXT}" -eq 0 ]; then
:
else
printf "Moving directory: %s -> %s\n" "${1}" "${nth_zindex_value}"
fi
mv "${1}" "${nth_zindex_value}"
if [ "$?" -ge 1 ]; then
printf "<m:::d> %bFAILED-> %s%b -> %b%s%b\n" "${tmodFailure}" "${1}" "${tmodReset}" "${tmodLabelCustomSED}" "${nth_zindex_value}" "${tmodReset}"
else
printf "<m:::d> %b%s%b -> %b%s%b\n" "${tmodSuccess}" "${1}" "${tmodReset}" "${tmodLabelCustomSED}" "${nth_zindex_value}" "${tmodReset}"
fi
else
printf "Undefined instance moving operation... falling back: Moving on...\n"
fi
fi
fi
}
if [ -z "${3}" ]; then
## Currently activating a glob
if [ -z "${nth_check}" ]; then
echo "You haven't supplied any arguements."
echo "Try: perform_move_generic <instance to move> <location to move the chosen instance to>"
elif [ -n "${z_check}" ] && [ -z "${nth_check}" ]; then
echo "Failed-> You haven't supplied a destination location to move that instance to."
echo "Try: perform_move_generic <instance to move> <location to move the chosen instance to>"
elif [ -n "${z_check}" ] && [ -n "${nth_check}" ]; then
if [ -f "${z_check}" ] || [ -d "${z_check}" ]; then
if [ -f "${z_check}" ]; then
if [ -f "${nth_check}" ]; then
if [ "${TRINE_CONTROL_VERBOSE}" == "1" ] || [ "${TRINE_CONTROL_VERBOSE}" -eq 1 ]; then
trine_control_already_exists "file"
else
:
fi
elif [ -d "${nth_check}" ]; then
if [ "${TRINE_CONTROL_VERBOSE}" == "1" ] || [ "${TRINE_CONTROL_VERBOSE}" -eq 1 ]; then
trine_control_already_exists "directory"
else
:
fi
if [ "${VERBOSE_CONTEXT}" -eq 0 ]; then
:
else
if [ "${TRINE_CONTROL_VERBOSE}" == "1" ] || [ "${TRINE_CONTROL_VERBOSE}" -eq 1 ]; then
trine_control_attaching_to_tree "${z_check}" "${nth_check}"
else
:
fi
fi
mv "${z_check}" "${nth_check}/${z_check}" ;
if [ "$?" -ge 1 ]; then
printf "<m::<T>:f> %bFAILED-> %s%b -> %b%s%b\n" "${tmodFailure}" "${z_check}" "${tmodReset}" "${tmodLabelCustomSED}" "${nth_check}" "${tmodReset}"
else
printf "<m::<T>:f> %b%s%b -> %b%s%b\n" "${tmodSuccess}" "${z_check}" "${tmodReset}" "${tmodLabelCustomSED}" "${nth_check}" "${tmodReset}"
fi
else
if [ "${VERBOSE_CONTEXT}" -eq 0 ]; then
:
else
if [ "${TRINE_CONTROL_VERBOSE}" == "1" ] || [ "${TRINE_CONTROL_VERBOSE}" -eq 1 ]; then
trine_control_move "file" "${z_check}" "${nth_check}"
else
:
fi
fi
mv "${z_check}" "${nth_check}" ;
if [ "$?" -ge 1 ]; then
printf "<m:::f> %bFAILED-> %s%b -> %b%s%b\n" "${tmodFailure}" "${z_check}" "${tmodReset}" "${tmodLabelCustomSED}" "${nth_check}" "${tmodReset}"
else
printf "<m:::f> %b%s%b -> %b%s%b\n" "${tmodSuccess}" "${z_check}" "${tmodReset}" "${tmodLabelCustomSED}" "${nth_check}" "${tmodReset}"
fi
fi
elif [ -d "${z_check}" ]; then
if [ -d "${nth_check}" ]; then
printf "That directory exists in the tree: Attaching to the instance now.\n"
if [ "${VERBOSE_CONTEXT}" -eq 0 ]; then
:
else
if [ "${TRINE_CONTROL_VERBOSE}" == "1" ] || [ "${TRINE_CONTROL_VERBOSE}" -eq 1 ]; then
trine_control_move "directory" "${z_check}" "${nth_check}"
else
:
fi
fi
mv "${z_check}" "${nth_check}/${z_check}" ;
if [ "$?" -ge 1 ]; then
printf "<m::<T>:d> %bFAILED-> %s%b -> %b%s%b\n" "${tmodFailure}" "${z_check}" "${tmodReset}" "${tmodFailed}" "${nth_check}" "${tmodReset}"
else
printf "<m::<T>:d> %b%s%b -> %b%s%b\n" "${tmodSuccess}" "${z_check}" "${tmodReset}" "${tmodLabelCustomSED}" "${nth_check}" "${tmodReset}"
fi
else
if [ "${VERBOSE_CONTEXT}" -eq 0 ]; then
:
else
printf "Moving directory: %s -> %s\n" "${z_check}" "${nth_check}"
fi
mv "${z_check}" "${nth_check}" ;
if [ "$?" -ge 1 ]; then
printf "<m:::d> %bFAILED-> %s%b -> %b%s%b\n" "${tmodFailure}" "${z_check}" "${tmodReset}" "${tmodLabelCustomSED}" "${nth_check}" "${tmodReset}"
else
printf "<m:::d> %b%s%b -> %b%s%b\n" "${tmodSuccess}" "${z_check}" "${tmodReset}" "${tmodLabelCustomSED}" "${nth_check}" "${tmodReset}"
fi
fi
fi
else
printf "You aren't providing a valid instance to move-> %s: does not exist.\n" "${z_check}"
fi
else
echo "Undefined error..."
echo "Try: perform_move_generic <instance to move> <location to move the chosen instance to>"
fi
else
if [ "${TRINE_CONTROL_VERBOSE}" == "1" ] || [ "${TRINE_CONTROL_VERBOSE}" -eq 1 ]; then
trine_control_glob "activated"
else
:
fi
while
glob_construct "$@"
counter_operations=$((counter_operations+1))
shift 1
do
: ;
done
if [ "${TRINE_CONTROL_VERBOSE}" == "1" ] || [ "${TRINE_CONTROL_VERBOSE}" -eq 1 ]; then
trine_control_instance_operations "${counter_operations}"
else
:
fi
fi
}
## pmri
## [X] Working
## [X] Compliant
perform_move_rename_instance() {
if [ -n "${1}" ] && [ -n "${2}" ]; then
## Cure for I/O opts in various environments
InputCured="${1}"
OutputCured="${2}"
if [ -f "${2}" ] || [ -d "${2}" ]; then
echo "Rename Failed-> The destination instance already exists. Skipping rename..."
if [ -f "${2}" ]; then
printf "The destination-> %s: is a file.\n" "${2}"
elif [ -d "${2}" ]; then
printf "The destination-> %s: is a directory.\n" "${2}"
else
printf "The destination-> %s: is of an unknown instance type. Aborting the operation.\n" "${2}"
fi
else
if [ "${VERBOSE_CONTEXT}" -eq 0 ]; then
:
else
printf "Renaming an instance: %s -> %s\n" "${1}" "${2}"
fi
if [ -f "${1}" ]; then
printf "Renaming a file: %s -> %s\n" "${1}" "${2}"
mv "${1}" "${2}" ;
if [ "$?" -ge 1 ]; then
printf "<m:::f> %bFAILED-> %s%b -> %b%s%b\n" "${tmodFailure}" "${InputCured}" "${tmodReset}" "${tmodLabelCustomSED}" "${OutputCured}" "${tmodReset}"
else
printf "<m:::f> %b%s%b -> %b%s%b\n" "${tmodSuccess}" "${InputCured}" "${tmodReset}" "${tmodLabelCustomSED}" "${OutputCured}" "${tmodReset}"
fi
elif [ -d "${1}" ]; then
printf "Renaming a directory: %s -> %s\n" "${1}" "${2}"
mv "${1}" "${2}" ;
if [ "$?" -ge 1 ]; then
printf "<m:::d> %bFAILED-> %s%b -> %b%s%b\n" "${tmodFailure}" "${InputCured}" "${tmodReset}" "${tmodLabelCustomSED}" "${OutputCured}" "${tmodReset}"
else
printf "<m:::d> %b%s%b -> %b%s%b\n" "${tmodSuccess}" "${InputCured}" "${tmodReset}" "${tmodLabelCustomSED}" "${OutputCured}" "${tmodReset}"
fi
else
printf "Renaming an unkonwn instance: %s -> %s\n" "${1}" "${2}"
mv "${1}" "${2}" ;
if [ "$?" -ge 1 ]; then
printf "<m:::U> %bFAILED-> %s%b -> %b%s%b\n" "${tmodFailure}" "${InputCured}" "${tmodReset}" "${tmodLabelCustomSED}" "${OutputCured}" "${tmodReset}"
else
printf "<m:::U> %b%s%b -> %b%s%b\n" "${tmodSuccess}" "${InputCured}" "${tmodReset}" "${tmodLabelCustomSED}" "${OutputCured}" "${tmodReset}"
fi
fi
fi
else
echo "You haven't supplied an instance to rename."
fi
}
## _removal_*
## prg
## [o] Working
## [o] Compliant
perform_removal_generic() {
## Counter
counter_operations=0
## removal_flag
export removal_flag=0
## Control Stack
IFS=","
set -- "$@"
z_check="${1}"
nth_check="${2}"
if [ "${TRINE_CONTROL_VERBOSE}" == "1" ] || [ "${TRINE_CONTROL_VERBOSE}" -eq 1 ]; then
trine_control_value_check "prg" "$*"
trine_control_value_expansion "${1}" "${2}"
else
:
fi
if [ -n "${z_check}" ] && [ -n "${nth_check}" ] && [ -n "${3}" ]; then
if [ "${TRINE_CONTROL_VERBOSE}" == "1" ] || [ "${TRINE_CONTROL_VERBOSE}" -eq 1 ]; then
trine_control_glob "activated"
else
:
fi
## Currently activating a glob
glob_construct() {
if [ "${1}" = "-R" ]; then
removal_flag=1
export removal_flag
elif [ -z "${1}" ]; then
if [ "${TRINE_CONTROL_VERBOSE}" == "1" ] || [ "${TRINE_CONTROL_VERBOSE}" -eq 1 ]; then
trine_control_glob "exhausted"
else
:
fi
else
if [ "${TRINE_CONTROL_VERBOSE}" == "1" ] || [ "${TRINE_CONTROL_VERBOSE}" -eq 1 ]; then
trine_control_item "${1}"
else
:
fi
## Complex logic here
if [ -f "${1}" ]; then
if [ "${VERBOSE_CONTEXT}" -eq 0 ]; then
:
else
printf "Removing a file: %s\n" "${1}"
fi
rm "${1}" ;
if [ "$?" -ge 1 ]; then
printf "<r:X:f> %bFAILED-> %s%b\n" "${tmodFailure}" "${1}" "${tmodReset}"
else
printf "<r:X:f> %b%s%b\n" "${tmodSuccess}" "${1}" "${tmodReset}"
fi
elif [ -d "${1}" ]; then
if [ "${removal_flag}" -eq 1 ]; then
if [ "${VERBOSE_CONTEXT}" -eq 0 ]; then
:
else
printf "Removing a directory: %s\n" "${1}"
fi
rm -R "${1}" ;
if [ "$?" -ge 1 ]; then
printf "<r:X:R:d> %bFAILED-> %s%b\n" "${tmodFailure}" "${1}" "${tmodReset}"
else
printf "<r:X:R:d> %b%s%b\n" "${tmodSuccess}" "${1}" "${tmodReset}"
fi
else
printf "No removal flag located: Skipping the removal of the directory-> %b%s%b\n" "${tmodFailure}" "${1}" "${tmodReset}"
fi
else
printf "z_check is-> %s\n" "${z_check}"
if [ "${z_check}" = "-R" ]; then
rm -R "${nth_check}" ;
if [ "$?" -ge 1 ]; then
printf "<r:A:R:d> %bFAILED-> %s%b\n" "${tmodFailure}" "${1}" "${tmodReset}"
else
printf "<r:A:R:d> %b%s%b\n" "${tmodSuccess}" "${1}" "${tmodReset}"
fi
else
echo "The recursive removal operation is undefined: Aborting..."
fi
fi
fi
}
while
glob_construct "$@"
counter_operations=$((counter_operations+1))
shift 1
do
: ;
done
if [ "${TRINE_CONTROL_VERBOSE}" == "1" ] || [ "${TRINE_CONTROL_VERBOSE}" -eq 1 ]; then
trine_control_instance_operations "${counter_operations}"
else
:
fi
elif [ "${z_check}" = "-R" ];then
if [ -f "${nth_check}" ]; then
if [ "${VERBOSE_CONTEXT}" -eq 0 ]; then
:
else
printf "Removing a file: %s\n" "${1}"
fi
rm "${nth_check}" ;
if [ "$?" -ge 1 ]; then
printf "<r::R:f> %bFAILED-> %s%b\n" "${tmodFailure}" "${nth_check}" "${tmodReset}"
else
printf "<r::R:f> %b%s%b\n" "${tmodSuccess}" "${nth_check}" "${tmodReset}"
fi
elif [ -d "${nth_check}" ]; then
if [ "${VERBOSE_CONTEXT}" -eq 0 ]; then
:
else
printf "Removing a directory: %s\n" "${1}"
fi
rm -R "${nth_check}" ;
if [ "$?" -ge 1 ]; then
printf "<r::R:d> %bFAILED-> %s%b\n" "${tmodFailure}" "${nth_check}" "${tmodReset}"
else
printf "<r::R:d> %b%s%b\n" "${tmodSuccess}" "${nth_check}" "${tmodReset}"
fi
else
printf "z_check is-> %s\n" "${z_check}"
if [ "${z_check}" = "-R" ]; then
rm -R "${nth_check}" ;
if [ "$?" -ge 1 ]; then
printf "<r:A:R:d> %bFAILED-> %s%b\n" "${tmodFailure}" "${1}" "${tmodReset}"
else
printf "<r:A:R:d> %b%s%b\n" "${tmodSuccess}" "${1}" "${tmodReset}"
fi
else
echo "The recursive removal operation is undefined: Aborting..."
fi
fi
elif [ -f "${z_check}" ]; then
if [ "${VERBOSE_CONTEXT}" -eq 0 ]; then
:
else
printf "Removing a file: %s\n" "${z_check}"
fi
rm "${z_check}" ;
if [ "$?" -ge 1 ]; then
printf "<r:::f> %bFAILED-> %s%b\n" "${tmodFailure}" "${z_check}" "${tmodReset}"
else
printf "<r:::f> %b%s%b\n" "${tmodSuccess}" "${z_check}" "${tmodReset}"
fi
elif [ -d "${z_check}" ]; then
printf "You need to pass the -R flag to remove a directory.\n"
printf "Example: perform_removal_generic -R <DIRECTORY_TO_REMOVE>\n"
elif [ -z "${z_check}" ]; then
echo "You haven't supplied a file to remove."
else
echo "The removal operation is undefined: Aborting..."
fi
}
## _modification_*
## All _modifications_* instances can be overloaded with an optional ${2} parameter.
## The default is _GENERIC values, but they can also take non-generic values too
## pmog
## [X] Working
## [x] Compliant
perform_modification_owner_generic() {
## Provide a failed REOPERTE instance
export FAILED_REOPERATE="0"
## Provide the single instance recursive flag
export RECURSIVE_FLAG="OFF"
unit_temp_file='tmp_file_XYZ100.txt'
## Counter
counter_operations=0
## Control Stack
IFS=","
set -- "$@"
zindex() {
zindex=$#
}
zindex "$@"
if [ "${TRINE_CONTROL_VERBOSE}" == "1" ] || [ "${TRINE_CONTROL_VERBOSE}" -eq 1 ]; then
trine_control_zindex "${zindex}"
else
:
fi
nth_zindex="${zindex}"
nth_zindex_value=$(eval "echo "\$$nth_zindex"") #"${!nth_zindex}" (BASH)
if [ "${TRINE_CONTROL_VERBOSE}" == "1" ] || [ "${TRINE_CONTROL_VERBOSE}" -eq 1 ]; then
trine_control_nth_zindex "${nth_zindex_value}"
else
:
fi
z_check="${1}"
nth_check="${2}"
if [ "${TRINE_CONTROL_VERBOSE}" == "1" ] || [ "${TRINE_CONTROL_VERBOSE}" -eq 1 ]; then
trine_control_value_check "pmog" "$*"
trine_control_value_expansion "${1}" "${2}"
else
:
fi
if [ -n "${z_check}" ] && [ -n "${nth_check}" ] && [ "${z_check}" != "-R" ]; then
## Currently activating a glob
if [ "${TRINE_CONTROL_VERBOSE}" == "1" ] || [ "${TRINE_CONTROL_VERBOSE}" -eq 1 ]; then
trine_control_glob "activated"
else
:
fi
glob_construct() {
## Context-switch
export ARG="${1}"
if [ -z "${ARG}" ]; then
if [ "${TRINE_CONTROL_VERBOSE}" == "1" ] || [ "${TRINE_CONTROL_VERBOSE}" -eq 1 ]; then
trine_control_glob "exhausted"
else
:
fi
else
if [ "${TRINE_CONTROL_VERBOSE}" == "1" ] || [ "${TRINE_CONTROL_VERBOSE}" -eq 1 ]; then
trine_control_item "${ARG}"
else
:
fi
## [X] Special Operations always have more than 2 arguments: Either a glob, or a custom permission
## Globs always present like this: pmog <CUSTOM_PERMISSIONS> <> <>
## Check for position 3rd in the updated/shifted list
## You can write custom alert messages or flags here
if [ -n "${3}" ]; then
if [ -f "${unit_temp_file}" ]; then
:
else
perform_creation_file "${unit_temp_file}"
fi
else
:
fi
if [ "${FAILED_REOPERATE}" = "0" ]; then
if [ "${VERBOSE_CONTEXT}" -eq 0 ]; then
:
else
if [ -f "${ARG}" ]; then
printf "Modifying the owner of file: %s to: %s\n" "${ARG}" "${GENERIC_CREATION_OWNER_FILE}"
elif [ -d "${ARG}" ]; then
printf "Modifying the owner of directory: %s to: %s\n" "${ARG}" "${GENERIC_CREATION_OWNER_DIRECTORY}"
else
echo "Checking for custom ownership args."
fi
fi
if [ -f "${ARG}" ]; then
determine_mint_logic "chown" "${GENERIC_CREATION_OWNER_FILE}" "${ARG}"
if [ "$?" -ge 1 ]; then
printf "<mod:o:SO:f> %bFAILED-> %s%b -> %b%s%b\n" "${tmodFailure}" "${ARG}" "${tmodReset}" "${tmodLabelCustomSED}" "${GENERIC_CREATION_OWNER_FILE}" "${tmodReset}"
else
printf "<mod:o:SO:f> %b%s%b -> %b%s%b\n" "${tmodSuccess}" "${ARG}" "${tmodReset}" "${tmodLabelCustomSED}" "${GENERIC_CREATION_OWNER_FILE}" "${tmodReset}"
fi
elif [ -d "${ARG}" ]; then
determine_mint_logic "chown" "${GENERIC_CREATION_OWNER_DIRECTORY}" "${ARG}"
if [ "$?" -ge 1 ]; then
printf "<mod:o:SO:d> %bFAILED-> %s%b -> %b%s%b\n" "${tmodFailure}" "${ARG}" "${tmodReset}" "${tmodLabelCustomSED}" "${GENERIC_CREATION_OWNER_DIRECTORY}" "${tmodReset}"
else
printf "<mod:o:SO:d> %b%s%b -> %b%s%b\n" "${tmodSuccess}" "${ARG}" "${tmodReset}" "${tmodLabelCustomSED}" "${GENERIC_CREATION_OWNER_DIRECTORY}" "${tmodReset}"
fi
else
if [ "${TRINE_CONTROL_VERBOSE}" == "1" ] || [ "${TRINE_CONTROL_VERBOSE}" -eq 1 ]; then
trine_control_reoperate "${ARG}"
else
:
fi
export FAILED_REOPERATE="${ARG}"
fi
else
if [ -f "${ARG}" ]; then
printf "Modifying the owner of file: %s to: %s\n" "${ARG}" "${FAILED_REOPERATE}"
elif [ -d "${ARG}" ]; then
printf "Modifying the owner of directory: %s to: %s\n" "${ARG}" "${FAILED_REOPERATE}"
else
echo "Checking for custom ownership args."
fi
if [ "${RECURSIVE_FLAG}" = "OFF" ]; then
## Utilizing custom ownership model
if [ -f "${ARG}" ]; then
determine_mint_logic "chown" "${FAILED_REOPERATE}" "${ARG}"
if [ "$?" -ge 1 ]; then
printf "<mod:o:SO:f> %bFAILED-> %s%b -> %b%s%b\n" "${tmodFailure}" "${ARG}" "${tmodReset}" "${tmodLabelCustomSED}" "${FAILED_REOPERATE}" "${tmodReset}"
else
printf "<mod:o:SO:f> %b%s%b -> %b%s%b\n" "${tmodSuccess}" "${ARG}" "${tmodReset}" "${tmodLabelCustomSED}" "${FAILED_REOPERATE}" "${tmodReset}"
fi
elif [ -d "${ARG}" ]; then
determine_mint_logic "chown" "${FAILED_REOPERATE}" "${ARG}"
if [ "$?" -ge 1 ]; then
printf "<mod:o:SO:d> %bFAILED-> %s%b -> %b%s%b\n" "${tmodSuccess}" "${ARG}" "${tmodReset}" "${tmodLabelCustomSED}" "${FAILED_REOPERATE}" "${tmodReset}"
else
printf "<mod:o:SO:d> %b%s%b -> %b%s%b\n" "${tmodSuccess}" "${ARG}" "${tmodReset}" "${tmodLabelCustomSED}" "${FAILED_REOPERATE}" "${tmodReset}"
fi
elif [ "${ARG}" = "-R" ]; then
export RECURSIVE_FLAG="ON"
else
printf "Invalid instance supplied-> %s :moving on\n" "${ARG}"
fi
elif [ "${RECURSIVE_FLAG}" = "ON" ]; then
determine_mint_logic "chown" "${FAILED_REOPERATE}" "-R ${ARG}"
if [ "$?" -ge 1 ]; then
printf "<mod:o:SO:R:d> -R %b%s%b -> %bFAILED-> %s%b\n" "${tmodFailure}" "${ARG}" "${tmodReset}" "${tmodLabelCustomSED}" "${FAILED_REOPERATE}" "${tmodReset}"
else
printf "<mod:o:SO:R:d> -R %b%s%b -> %b%s%b\n" "${tmodSuccess}" "${ARG}" "${tmodReset}" "${tmodLabelCustomSED}" "${FAILED_REOPERATE}" "${tmodReset}"
fi
else
printf "Invalid instance supplied-> %s :moving on\n" "${ARG}"
fi
fi
if [ -f "${unit_temp_file}" ]; then
echo "Removing lock-file"
perform_removal_generic "${unit_temp_file}"
else
:
fi
fi
}
while
glob_construct "$@"
counter_operations=$((counter_operations+1))
shift 1
do
: ;
done
if [ "${TRINE_CONTROL_VERBOSE}" == "1" ] || [ "${TRINE_CONTROL_VERBOSE}" -eq 1 ]; then
trine_control_instance_operations "${counter_operations}"
else
:
fi
elif [ -n "${z_check}" ]; then
if [ "${z_check}" = "-R" ]; then
if [ -z "${nth_check}" ]; then
echo "You need to supply a instance for the -R default ownership operation to be applied to."
echo "Example: pmog -R <INSTANCE_TO_APPLY_OWNERSHIP_CHANGE_TO>"
else
## recursive generic logic here
if [ -f "${nth_check}" ]; then
determine_mint_logic "chown" "${GENERIC_CREATION_OWNER_FILE}" "-R ${nth_check}"
if [ "$?" -ge 1 ]; then
printf "<mod:o:g:R:f> -R %bFAILED-> %s%b -> %b%s%b\n" "${tmodFailure}" "${nth_check}" "${tmodReset}" "${tmodLabelCustomSED}" "${GENERIC_CREATION_OWNER_FILE}" "${tmodReset}"
else
printf "<mod:o:g:R:f> -R %b%s%b -> %b%s%b\n" "${tmodSuccess}" "${nth_check}" "${tmodReset}" "${tmodLabelCustomSED}" "${GENERIC_CREATION_OWNER_FILE}" "${tmodReset}"
fi
elif [ -d "${nth_check}" ]; then
determine_mint_logic "chown" "${GENERIC_CREATION_OWNER_DIRECTORY}" "-R ${nth_check}"
if [ "$?" -ge 1 ]; then
printf "<mod:o:g:R:d> -R %bFAILED-> %s%b -> %b%s%b\n" "${tmodSuccess}" "${nth_check}" "${tmodReset}" "${tmodLabelCustomSED}" "${GENERIC_CREATION_OWNER_DIRECTORY}" "${tmodReset}"
else
printf "<mod:o:g:R:d> -R %b%s%b -> %b%s%b\n" "${tmodSuccess}" "${nth_check}" "${tmodReset}" "${tmodLabelCustomSED}" "${GENERIC_CREATION_OWNER_DIRECTORY}" "${tmodReset}"
fi
else
echo "That instance doesn't exist. Supply -R with another one that's valid."
fi
fi
else
if [ -f "${z_check}" ]; then
determine_mint_logic "chown" "${GENERIC_CREATION_OWNER_FILE}" "${z_check}"
if [ "$?" -ge 1 ]; then
printf "<mod:o:g:f> %bFAILED-> %s%b -> %b%s%b\n" "${tmodFailure}" "${nth_check}" "${tmodReset}" "${tmodLabelCustomSED}" "${GENERIC_CREATION_OWNER_FILE}" "${tmodReset}"
else
printf "<mod:o:g:f> %b%s%b -> %b%s%b\n" "${tmodSuccess}" "${nth_check}" "${tmodReset}" "${tmodLabelCustomSED}" "${GENERIC_CREATION_OWNER_FILE}" "${tmodReset}"
fi
elif [ -d "${z_check}" ]; then
determine_mint_logic "chown" "${GENERIC_CREATION_OWNER_DIRECTORY}" "${z_check}"
if [ "$?" -ge 1 ]; then
printf "<mod:o:g:d> -R %bFAILED-> %s%b -> %b%s%b\n" "${tmodFailure}" "${nth_check}" "${tmodReset}" "${tmodLabelCustomSED}" "${GENERIC_CREATION_OWNER_DIRECTORY}" "${tmodReset}"
else
printf "<mod:o:g:d> -R %b%s%b -> %b%s%b\n" "${tmodSuccess}" "${nth_check}" "${tmodReset}" "${tmodLabelCustomSED}" "${GENERIC_CREATION_OWNER_DIRECTORY}" "${tmodReset}"
fi
else
echo "That instance doesn't exist. Try another one that's valid."
fi
fi
elif [ -z "${z_check}" ]; then
## No arguements supplied
echo "You haven't supplied anything to modify the owner for."
else
echo "Unsupported ownership modification operation."
fi
}
## pmpg
## [X] Working
## [X] Compliant
perform_modification_permissions_generic() {
## Provide a failed REOPERTE instance
export FAILED_REOPERATE="0"
## Provide the single instance recursive flag
export RECURSIVE_FLAG="OFF"
unit_temp_file='tmp_file_XYZ100.txt'
## Counter
counter_operations=0
## Control Stack
IFS=","
set -- "$@"
z_check="${1}"
nth_check="${2}"
if [ "${TRINE_CONTROL_VERBOSE}" == "1" ] || [ "${TRINE_CONTROL_VERBOSE}" -eq 1 ]; then
trine_control_value_check "pmpg" "$*"
trine_control_value_expansion "${1}" "${2}"
else
:
fi
if [ -n "${z_check}" ] && [ -n "${nth_check}" ] && [ "${z_check}" != "-R" ]; then
## Currently activating a glob
if [ "${TRINE_CONTROL_VERBOSE}" == "1" ] || [ "${TRINE_CONTROL_VERBOSE}" -eq 1 ]; then
trine_control_glob "activated"
else
:
fi
glob_construct() {
## Context-switch
export ARG="${1}"
if [ -z "${ARG}" ]; then
if [ "${TRINE_CONTROL_VERBOSE}" == "1" ] || [ "${TRINE_CONTROL_VERBOSE}" -eq 1 ]; then
trine_control_glob "exhausted"
else
:
fi
else
if [ "${TRINE_CONTROL_VERBOSE}" == "1" ] || [ "${TRINE_CONTROL_VERBOSE}" -eq 1 ]; then
trine_control_item "${ARG}"
else
:
fi
## [X] Special Operations always have more than 2 arguments: Either a glob, or a custom permission
## Globs always present like this: pmog <CUSTOM_PERMISSIONS> <> <>
## Check for position 3rd in the updated/shifted list
## You can write custom alert messages or flags here
if [ -n "${3}" ]; then
if [ -f "${unit_temp_file}" ]; then
:
else
perform_creation_file "${unit_temp_file}"
fi
else
:
fi
if [ "${FAILED_REOPERATE}" = "0" ]; then
if [ "${VERBOSE_CONTEXT}" -eq 0 ]; then
:
else
if [ -f "${ARG}" ]; then
printf "Modifying the permissions for the file: %s to: %s\n" "${ARG}" "${GENERIC_CREATION_PERMISSIONS_FILE}"
elif [ -d "${ARG}" ]; then
printf "Modifying the permissions for the directory: %s to: %s\n" "${ARG}" "${GENERIC_CREATION_PERMISSIONS_DIRECTORY}"
else
echo "Checking for custom permission-based args."
fi
fi
if [ -f "${ARG}" ]; then
determine_mint_logic "chmod" "${GENERIC_CREATION_PERMISSIONS_FILE}" "${ARG}"
if [ "$?" -ge 1 ]; then
printf "<mod:p:SO:f> %bFAILED-> %s%b -> %b%s%b\n" "${tmodFailure}" "${ARG}" "${tmodReset}" "${tmodLabelCustomSED}" "${GENERIC_CREATION_PERMISSIONS_FILE}" "${tmodReset}"
else
printf "<mod:p:SO:f> %b%s%b -> %b%s%b\n" "${tmodSuccess}" "${ARG}" "${tmodReset}" "${tmodLabelCustomSED}" "${GENERIC_CREATION_PERMISSIONS_FILE}" "${tmodReset}"
fi
elif [ -d "${ARG}" ]; then
determine_mint_logic "chmod" "${GENERIC_CREATION_PERMISSIONS_DIRECTORY}" "${ARG}"
if [ "$?" -ge 1 ]; then
printf "<mod:p:SO:d> %bFAILED-> %s%b -> %b%s%b\n" "${tmodFailure}" "${ARG}" "${tmodReset}" "${tmodLabelCustomSED}" "${GENERIC_CREATION_PERMISSIONS_DIRECTORY}" "${tmodReset}"
else
printf "<mod:p:SO:d> %b%s%b -> %b%s%b\n" "${tmodSuccess}" "${ARG}" "${tmodReset}" "${tmodLabelCustomSED}" "${GENERIC_CREATION_PERMISSIONS_DIRECTORY}" "${tmodReset}"
fi
else
if [ "${TRINE_CONTROL_VERBOSE}" == "1" ] || [ "${TRINE_CONTROL_VERBOSE}" -eq 1 ]; then
trine_control_reoperate "${ARG}"
:
fi
export FAILED_REOPERATE="${ARG}"
fi
else
if [ -f "${ARG}" ]; then
printf "Modifying the permissions for the file: %s to: %s\n" "${ARG}" "${FAILED_REOPERATE}"
elif [ -d "${ARG}" ]; then
printf "Modifying the permissions for the directory: %s to: %s\n" "${ARG}" "${FAILED_REOPERATE}"
else
echo "Checking for custom permission-based args."
fi
if [ "${RECURSIVE_FLAG}" = "OFF" ]; then
## Utilizing custom permissions model
if [ -f "${ARG}" ]; then
determine_mint_logic "chmod" "${FAILED_REOPERATE}" "${ARG}"
printf "<mod:p:SO:f> %b%s%b -> %b%s%b\n" "${tmodSuccess}" "${ARG}" "${tmodReset}" "${tmodLabelCustomSED}" "${FAILED_REOPERATE}" "${tmodReset}"
elif [ -d "${ARG}" ]; then
determine_mint_logic "chmod" "${FAILED_REOPERATE}" "${ARG}"
if [ "$?" -ge 1 ]; then
printf "<mod:p:SO:d> %bFAILED-> %s%b -> %b%s%b\n" "${tmodFailure}" "${ARG}" "${tmodReset}" "${tmodLabelCustomSED}" "${FAILED_REOPERATE}" "${tmodReset}"
else
printf "<mod:p:SO:d> %b%s%b -> %b%s%b\n" "${tmodSuccess}" "${ARG}" "${tmodReset}" "${tmodLabelCustomSED}" "${FAILED_REOPERATE}" "${tmodReset}"
fi
elif [ "${ARG}" = "-R" ]; then
export RECURSIVE_FLAG="ON"
else
printf "Invalid instance supplied-> %s :moving on\n" "${ARG}"
fi
elif [ "${RECURSIVE_FLAG}" = "ON" ]; then
determine_mint_logic "chmod" "${FAILED_REOPERATE}" "-R ${ARG}"
if [ "$?" -ge 1 ]; then
printf "<mod:p:SO:R:d> -R %bFAILED-> %s%b -> %b%s%b\n" "${tmodFailure}" "${ARG}" "${tmodReset}" "${tmodLabelCustomSED}" "${FAILED_REOPERATE}" "${tmodReset}"
else
printf "<mod:p:SO:R:d> -R %b%s%b -> %b%s%b\n" "${tmodSuccess}" "${ARG}" "${tmodReset}" "${tmodLabelCustomSED}" "${FAILED_REOPERATE}" "${tmodReset}"
fi
else
printf "Invalid instance supplied-> %s :moving on\n" "${ARG}"
fi
fi
if [ -f "${unit_temp_file}" ]; then
echo "Removing lock-file"
perform_removal_generic "${unit_temp_file}"
else
:
fi
fi
}
while
glob_construct "$@"
counter_operations=$((counter_operations+1))
shift 1
do
: ;
done
if [ "${TRINE_CONTROL_VERBOSE}" == "1" ] || [ "${TRINE_CONTROL_VERBOSE}" -eq 1 ]; then
trine_control_instance_operations "${counter_operations}"
else
:
fi
elif [ -n "${z_check}" ]; then
if [ "${z_check}" = "-R" ]; then
if [ -z "${nth_check}" ]; then
echo "You need to supply a instance for the -R default permissions operation to be applied to."
echo "Example: pmog -R <INSTANCE_TO_APPLY_PERMISSIONS_CHANGE_TO>"
else
## recursive generic logic here
if [ -f "${nth_check}" ]; then
determine_mint_logic "chmod" "${GENERIC_CREATION_PERMISSIONS_FILE}" "-R ${nth_check}"
if [ "$?" -ge 1 ]; then
printf "<mod:p:g:R:f> -R %bFAILED-> %s%b -> %b%s%b\n" "${tmodFailure}" "${nth_check}" "${tmodReset}" "${tmodLabelCustomSED}" "${GENERIC_CREATION_PERMISSIONS_FILE}" "${tmodReset}"
else
printf "<mod:p:g:R:f> -R %b%s%b -> %b%s%b\n" "${tmodSuccess}" "${nth_check}" "${tmodReset}" "${tmodLabelCustomSED}" "${GENERIC_CREATION_PERMISSIONS_FILE}" "${tmodReset}"
fi
elif [ -d "${nth_check}" ]; then
determine_mint_logic "chmod" "${GENERIC_CREATION_PERMISSIONS_DIRECTORY}" "-R ${nth_check}"
if [ "$?" -ge 1 ]; then
printf "<mod:p:g:R:d> -R %bFAILED-> %s%b -> %b%s%b\n" "${tmodFailure}" "${nth_check}" "${tmodReset}" "${tmodLabelCustomSED}" "${GENERIC_CREATION_PERMISSIONS_DIRECTORY}" "${tmodReset}"
else
printf "<mod:p:g:R:d> -R %b%s%b -> %b%s%b\n" "${tmodSuccess}" "${nth_check}" "${tmodReset}" "${tmodLabelCustomSED}" "${GENERIC_CREATION_PERMISSIONS_DIRECTORY}" "${tmodReset}"
fi
else
echo "That instance doesn't exist. Supply -R with another one that's valid."
fi
fi
else
if [ -f "${z_check}" ]; then
determine_mint_logic "chmod" "${GENERIC_CREATION_PERMISSIONS_FILE}" "${z_check}"
if [ "$?" -ge 1 ]; then
printf "<mod:p:g:f> %bFAILED-> %s%b -> %b%s%b\n" "${tmodFailure}" "${nth_check}" "${tmodReset}" "${tmodLabelCustomSED}" "${GENERIC_CREATION_PERMISSIONS_FILE}" "${tmodReset}"
else
printf "<mod:p:g:f> %b%s%b -> %b%s%b\n" "${tmodSuccess}" "${nth_check}" "${tmodReset}" "${tmodLabelCustomSED}" "${GENERIC_CREATION_PERMISSIONS_FILE}" "${tmodReset}"
fi
elif [ -d "${z_check}" ]; then
determine_mint_logic "chmod" "${GENERIC_CREATION_PERMISSIONS_DIRECTORY}" "${z_check}"
if [ "$?" -ge 1 ]; then
printf "<mod:p:g:d> -R %bFAILED-> %s%b -> %b%s%b\n" "${tmodFailure}" "${nth_check}" "${tmodReset}" "${tmodLabelCustomSED}" "${GENERIC_CREATION_PERMISSIONS_DIRECTORY}" "${tmodReset}"
else
printf "<mod:p:g:d> -R %b%s%b -> %b%s%b\n" "${tmodSuccess}" "${nth_check}" "${tmodReset}" "${tmodLabelCustomSED}" "${GENERIC_CREATION_PERMISSIONS_DIRECTORY}" "${tmodReset}"
fi
else
echo "That instance doesn't exist. Try another one that's valid."
fi
fi
elif [ -z "${z_check}" ]; then
## No arguements supplied
echo "You haven't supplied anything to modify the permissions for."
else
echo "Unsupported permissions modification operation."
fi
}
## perform_tree_walk
## Working [x]
## Compliant [x]
perform_tree_walk() {
TRINE_CWD_PREVIOUS="$(pwd)"
export TRINE_CWD_PREVIOUS
TRINE_CWD="$(pwd)"
iE=""
export TRINE_CWD
if [ "${2}" = "${1}" ]; then
iE="Y"
else
iE="N"
fi
## Primary Cases
if [ -f "${1}" ]; then
printf "Can't walk into a file: %b%s%b\n" "${tmodFailure}" "${1}" "${tmodReset}"
elif [ -d "${1}" ]; then
cd "${1}" || return;
if [ "$?" -ge 1 ]; then
printf "<w:d> e:%s %b%s%b\n" "${iE}" "${tmodFailure}" "${1}" "${tmodReset}"
else
printf "<w:d> e:%s %b%s%b\n" "${iE}" "${tmodSuccess}" "${1}" "${tmodReset}"
TRINE_CWD="$(pwd)"
export TRINE_CWD
if [ "${TRINE_PATHS_VERBOSE}" -eq 1 ]; then
printf "[d] %b%s%b\n" "${tmodLabelCustomSED}" "${TRINE_CWD}" "${tmodReset}"
else
:
fi
fi
## Extra Cases
elif [ -b "${1}" ]; then
printf "Can't walk into the block-device: %b%s%b\n" "${tmodFailure}" "${1}" "${tmodReset}"
elif [ -c "${1}" ]; then
printf "Can't walk into the character-special device: %b%s%b\n" "${tmodFailure}" "${1}" "${tmodReset}"
elif [ -L "${1}" ]; then
if [ "${TRINE_FOLLOW_SYMBOLIC_LINKS}" = 1 ]; then
cd "${1}" || return;
if [ "$?" -ge 1 ]; then
printf "<w:sl:d> e:%s %b%s%b\n" "${iE}" "${tmodFailure}" "${1}" "${tmodReset}"
else
printf "<w:sl:d> e:%s %b%s%b\n" "${iE}" "${tmodSuccess}" "${1}" "${tmodReset}"
TRINE_CWD="$(pwd)"
export TRINE_CWD
if [ "${TRINE_PATHS_VERBOSE}" -eq 1 ]; then
printf "[d] %b%s%b\n" "${tmodLabelCustomSED}" "${TRINE_CWD}" "${tmodReset}"
else
:
fi
fi
else
printf "Can't walk into the symbolic link when follow symlinks is turned off: %b%s%b\n" "${tmodFailure}" "${1}" "${tmodReset}"
fi
elif [ -S "${1}" ]; then
printf "Can't walk into the network-socket: %b%s%b\n" "${tmodFailure}" "${1}" "${tmodReset}"
else
printf "Can't walk into a file: %b%s%b\n" "${tmodFailure}" "${1}" "${tmodReset}"
fi
}
## perform_tree_walk_protected
## Working [x]
## Compliant [x]
perform_tree_walk_protected() {
TRINE_CWD_PREVIOUS="$(pwd)"
export TRINE_CWD_PREVIOUS
TRINE_CWD="$(pwd)"
iE=""
export TRINE_CWD
if [ "${2}" = "${1}" ]; then
iE="Y"
else
iE="N"
fi
## Primary Cases
if [ -f "${1}" ]; then
printf "Can't walk into a file: %b%s%b\n" "${tmodFailure}" "${1}" "${tmodReset}"
elif [ -d "${1}" ]; then
cd "${1}" || exit;
if [ "$?" -ge 1 ]; then
printf "<w:d> e:%s %b%s%b\n" "${iE}" "${tmodFailure}" "${1}" "${tmodReset}"
else
printf "<w:d> e:%s %b%s%b\n" "${iE}" "${tmodSuccess}" "${1}" "${tmodReset}"
TRINE_CWD="$(pwd)"
export TRINE_CWD
if [ "${TRINE_PATHS_VERBOSE}" -eq 1 ]; then
printf "[d] %b%s%b\n" "${tmodLabelCustomSED}" "${TRINE_CWD}" "${tmodReset}"
else
:
fi
fi
## Extra Cases
elif [ -b "${1}" ]; then
printf "Can't walk into the block-device: %b%s%b\n" "${tmodFailure}" "${1}" "${tmodReset}"
elif [ -c "${1}" ]; then
printf "Can't walk into the character-special device: %b%s%b\n" "${tmodFailure}" "${1}" "${tmodReset}"
elif [ -L "${1}" ]; then
if [ "${TRINE_FOLLOW_SYMBOLIC_LINKS}" = 1 ]; then
cd "${1}" || exit;
if [ "$?" -ge 1 ]; then
printf "<w:sl:d> e:%s %b%s%b\n" "${iE}" "${tmodFailure}" "${1}" "${tmodReset}"
else
printf "<w:sl:d> e:%s %b%s%b\n" "${iE}" "${tmodSuccess}" "${1}" "${tmodReset}"
TRINE_CWD="$(pwd)"
export TRINE_CWD
if [ "${TRINE_PATHS_VERBOSE}" -eq 1 ]; then
printf "[d] %b%s%b\n" "${tmodLabelCustomSED}" "${TRINE_CWD}" "${tmodReset}"
else
:
fi
fi
else
printf "Can't walk into the symbolic link when follow symlinks is turned off: %b%s%b\n" "${tmodFailure}" "${1}" "${tmodReset}"
fi
elif [ -S "${1}" ]; then
printf "Can't walk into the network-socket: %b%s%b\n" "${tmodFailure}" "${1}" "${tmodReset}"
else
printf "Can't walk into a file: %b%s%b\n" "${tmodFailure}" "${1}" "${tmodReset}"
fi
}
perform_tree_teleport_back() {
cd "${TRINE_CWD_PREVIOUS}" || return
TRINE_CWD_PREVIOUS="$(pwd)"
export TRINE_CWD_PREVIOUS
TRINE_CWD="$(pwd)"
export TRINE_CWD
printf "[d] %b%s%b\n" "${tmodLabelCustomSED}" "${TRINE_CWD}" "${tmodReset}"
}
perform_tree_teleport_back_protected() {
cd "${TRINE_CWD_PREVIOUS}" || exit
TRINE_CWD_PREVIOUS="$(pwd)"
export TRINE_CWD_PREVIOUS
TRINE_CWD="$(pwd)"
export TRINE_CWD
printf "[d] %b%s%b\n" "${tmodLabelCustomSED}" "${TRINE_CWD}" "${tmodReset}"
}
perform_tree_teleport_up() {
cd "../" || return
TRINE_CWD_PREVIOUS="${TRINE_CWD}"
export TRINE_CWD_PREVIOUS
TRINE_CWD="$(pwd)"
export TRINE_CWD
printf "[d] %b%s%b\n" "${tmodLabelCustomSED}" "${TRINE_CWD}" "${tmodReset}"
}
perform_tree_teleport_up_protected() {
cd "../" || exit
TRINE_CWD_PREVIOUS="${TRINE_CWD}"
export TRINE_CWD_PREVIOUS
TRINE_CWD="$(pwd)"
export TRINE_CWD
printf "[d] %b%s%b\n" "${tmodLabelCustomSED}" "${TRINE_CWD}" "${tmodReset}"
}
## Generic wrapper/starter function
## Provided Construct
#NAVIGATION_*SPECIAL_LOCATION_ENDPOINT_LABEL_NAME*_SPECIAL() {
# ## /run/*VIRTUAL_BACKUP_LOCATION*/*SEGMENT_ID_LOCATION*/*SPECIAL_LOCATION_ENDPOINT*
# if [ -d "${LABEL_*SPECIAL_LOCATION_ENDPOINT_LABEL_NAME*}" ]; then
# perform_tree_walk "${LABEL_*SPECIAL_LOCATION_ENDPOINT_LABEL_NAME*}"
# else
# alert_location_special_not_found "${LABEL_*SPECIAL_LOCATION_ENDPOINT_LABEL_NAME*}"
# fi
#}
performTreeWalk() {
# 1 is the label, 2 is the expected path
if [ -d "${1}" ]; then
perform_tree_walk "${1}" "${2}"
else
alert_location_special_not_found "${1}"
fi
}
###############################################################################
## Perform special operations
###############################################################################
## perform_system_action ${1} = systemctl, ${2} = ... $N = ....
perform_system_action() {
was_deployed() {
sudo "${1}" "${2}" ;
printf " -> %b%s%b <A> %s\n" "${tmodSuccess}" "${1}" "${tmodReset}" "${2}"
}
was_success() {
sudo "${1}" "${2}" "${3}" ;
printf " -> %b%s:%b %s <%s> %s\n" "${tmodSuccess}" "${3}" "${tmodReset}" "${1}" "${4}" "${2}"
}
action_j_injest() {
if [ "${2}" = "--flush" ]; then
printf "%s-> ACTION: --flush\n" "${1}"
was_deployed "${1}" "${2}" "${1}-> ACTION: ${2}"
elif [ "${2}" = "--rotate" ]; then
printf "%s-> ACTION: --rotate\n" "${1}"
was_deployed "${1}" "${2}" "${1}-> ACTION: ${2}"
else
echo "Unsupported journalctl automation option: Try-> --flush, --rotate"
fi
}
action_z_injest() {
if [ "${2}" = "start" ]; then
printf "%s-> ACTION: start\n" "${1}"
was_success "${1}" "${2}" "${3}" "${1}-> ACTION: ${2}"
elif [ "${2}" = "stop" ]; then
printf "%s-> ACTION: stop\n" "${1}"
was_success "${1}" "${2}" "${3}" "${1}-> ACTION: ${2}"
elif [ "${2}" = "restart" ]; then
printf "%s-> ACTION: restart\n" "${1}"
was_success "${1}" "${2}" "${3}" "${1}-> ACTION: ${2}"
elif [ "${2}" = "disable" ]; then
printf "%s-> ACTION: disable" "${1}"
was_success "${1}" "${2}" "${3}" "${1}-> ACTION: ${2}"
elif [ "${2}" = "enable" ]; then
printf "%s-> ACTION: enable" "${1}"
was_success "${1}" "${2}" "${3}" "${1}-> ACTION: ${2}"
else
echo "Invalid systemctl option: Try-> start, stop, restart"
fi
}
action_python_injest() {
if [ "${2}" = "-m" ] && [ -n "${3}" ] && [ -n "${4}" ]; then
#su - standard -c "python -m ${3} ${4}" ;
python -m "${3}" "${4}" ;
else
echo "Invalid python option: Try-> python -m V_STARTER PATH_TO_VE"
fi
}
action_source_injest() {
if [ -f "${2}" ]; then
. "${2}" ;
else
echo "Invalid source location: You can't attempt to source that location because it isn't a file."
fi
}
action_pip_injest() {
if [ "${2}" = "install" ]; then
## Option waterfall, followed by allowed program verification
if [ "${3}" = "--upgrade" ]; then
pip install --upgrade pip ;
elif [ "${3}" = "-r" ]; then
if [ -f "${4}" ]; then
pip install -r "${4}" ;
else
echo "The provided location: ${4} was not able to be used as a install slug for pip... falling back..."
fi
else
pip_assembler() {
printf "Looking up pip-element: %b%s%b\n" "${tmodLabelCustomNavigation}" "${1}" "${tmodReset}"
if [ -z "${1}" ]; then
:
elif [ "${ITEM_CREDENTIAL}" = "${1}" ]; then
ALLOWED_PROGRAM="${1}"
printf "PROGRAM ALLOWED: %b%s
%b" "${tmodWarning}" "${ALLOWED_PROGRAM}" "${tmodReset}"
pip install "${ITEM_CREDENTIAL}" ;
else
:
fi
}
## Build the initial item credential
ITEM_CREDENTIAL="${3}"
## Perform limiters
IFS=","
set -- ${ALLOWED_PROGRAMS_PYTHON_PIP}
z_check="${1}"
nth_check="${2}"
ALLOWED_PROGRAM="NONE"
printf "Passed program-request: %s\n" "${ITEM_CREDENTIAL}"
if [ "${TRINE_CONTROL_VERBOSE}" == "1" ] || [ "${TRINE_CONTROL_VERBOSE}" -eq 1 ]; then
trine_control_value_check "psa" "$*"
trine_control_value_expansion "${1}" "${2}"
trine_control_value_item_credential "${3}"
else
:
fi
printf "Allowed Pip-ready programs: %s\n" "${ALLOWED_PROGRAMS_PYTHON_PIP}"
while [ "$#" -gt 0 ]; do
pip_assembler "$@"
counter_operations=$((counter_operations+1))
shift 1
done
if [ "${TRINE_CONTROL_VERBOSE}" == "1" ] || [ "${TRINE_CONTROL_VERBOSE}" -eq 1 ]; then
trine_control_instance_operations "${counter_operations}"
else
:
fi
if [ "${ALLOWED_PROGRAM}" = "NONE" ]; then
echo "You haven't provided a valid pip flag, or the program you're trying to install is not explicitly allowed"
echo "Try -r, or --upgrade as a flag, or pass a valid program. Add more in your allowed program array in ALL_*"
else
:
fi
fi
else
echo "The pip wrapper only supports pip install *."
fi
}
action_deactivate() {
if [ "${1}" = "deactivate" ]; then
deactivate ;
else
echo "You can't deactivate an instance without passing the deactivate action."
fi
}
## Conditional "${2}" and more args, runner
if [ -z "${2}" ] && [ "${1}" != "deactivate" ]; then
echo "You aren't supplying enough arguements to perform a system action."
else
if [ -z "${3}" ] && [ "${1}" != "source" ] || [ -z "${2}" ] && [ "${1}" != "deactivate" ] || [ "${1}" != "journalctl" ] && [ -z "${2}" ]; then
printf "FAILED-> %bYou have to provide a third option to any system action.%b\n" "${tmodFailure}" "${tmodReset}"
else
## Injestion-supported or scoped-actions here:
if [ "${1}" = "journalctl" ]; then
printf "Evaluating-> [1]: %s [2]: %s\n" "${1}" "${2}"
action_j_injest "${1}" "${2}"
elif [ "${1}" = "systemctl" ]; then
printf "Evaluating-> [1]: %s [2]: %s [3]: %s\n" "${1}" "${2}" "${3}"
action_z_injest "${1}" "${2}" "${3}"
elif [ "${1}" = "python" ]; then
printf "Evaluating-> [1]: %s [2]: %s [3]: %s [4]: %s\n" "${1}" "${2}" "${3}" "${4}"
action_python_injest "${1}" "${2}" "${3}" "${4}"
elif [ "${1}" = "source" ]; then
printf "Evaluating-> [1]: %s [2]: %s\n" "${1}" "${2}"
action_source_injest "${1}" "${2}"
elif [ "${1}" = "pip" ]; then
printf "Evaluating-> [1]: %s [2]: %s [3]: %s [4]: %s\n" "${1}" "${2}" "${3}" "${4}"
action_pip_injest "${1}" "${2}" "${3}" "${4}"
#elif [ "${1}" = "X" ]; then
## Singular Action Wrappers
elif [ "${1}" = "deactivate" ]; then
printf "Evaluating-> [1]: %s\n" "${1}"
action_deactivate "${1}"
#elif [ "${N_CLAUSE}" = "N_ACTION" ]; then
else
printf "FAILED-> %bUnsupported system action provided. Try-> systemctl *ACTION* *UNIT*%b\n" "${tmodFailure}" "${tmodReset}"
fi
fi
fi
}
###############################################################################
## Perform special operations
###############################################################################
## hpr
## pipe /dev/null to .bash_history to delete it entirely
perform_history_purge_root() {
if [ "$(id -u)" -eq "${SCRIPT_ACS_RUNNER_DUGOUT}" ]; then
if [ -n "${PATH_DEV_NULL}" ]; then
touch OPERATIONS_FILE.txt ;
if [ -f "${BASH_HISTORY_ROOT}" ]; then
cat "${PATH_DEV_NULL}" > "${BASH_HISTORY_ROOT}" ;
history -c ;
rm OPERATIONS_FILE.txt ;
printf "root history-> %b%s: Cleared...%b\n" "${tmodSuccess}" "${BASH_HISTORY_ROOT}" "${tmodReset}"
else
printf "There wasn't a valid bash history instance located at the provided location: %s\n" "${BASH_HISTORY_ROOT}"
rm OPERATIONS_FILE.txt ;
fi
else
echo "You need to provide a null-location to nullify your system history."
fi
else
echo "You need to become the root account before performing this action. Nothing was provided."
fi
}
## hpu
perform_history_purge_user() {
if [ "$(id -u)" -eq "${SCRIPT_ACS_RUNNER_DUGOUT}" ]; then
echo "You can't be the root user to execute the default users history purge."
else
if [ -n "${PATH_DEV_NULL}" ]; then
touch OPERATIONS_FILE.txt ;
if [ -f "${BASH_HISTORY_GENERIC}" ]; then
cat "${PATH_DEV_NULL}" > "${BASH_HISTORY_GENERIC}" ;
history -c ;
rm OPERATIONS_FILE.txt ;
printf "User history-> %b%s: Cleared...%b\n" "${tmodSuccess}" "${BASH_HISTORY_GENERIC}" "${tmodReset}"
else
printf "There wasn't a valid bash history instance located at the provided location: %s\n" "${BASH_HISTORY_ROOT}"
rm OPERATIONS_FILE.txt ;
fi
else
echo "You need to provide a null-location to nullify your system history. Nothing was provided."
fi
fi
}
## tupr ${1}
## Untar all .tar files in the current directory
perform_tar_unpack_recursive() {
if [ -n "${1}" ]; then
if [ -d "${1}" ]; then
extend_lockeddown_mint_operations "find" "${1}" "f" "tar" "-xf"
else
printf "FAILED-> %bThe path you're supplying must be a valid directory.%b\n" "${tmodFailure}" "${tmodReset}"
printf "PATH-> was: %s\n" "${1}"
fi
else
echo "You need to provide a valid '$PATH' as the input to recursively unpack tar archives from."
printf "Input was-> Empty"
echo "tupr /MEDIA/ARCHIVES"
fi
}
###############################################################################
### helper_*: Run helper wrappers
###############################################################################
## ACS_CHECK
helper_acs_check() {
if [ "${ACS_CHECK}" = 1 ]; then
alert_acs_yes "${1}"
else
alert_acs_no "${1}"
fi
}
###############################################################################
## Helper Instance -> Map program specific functionality to an alias
###############################################################################
### helper_*
## Environment
helper_environment_logout() {
if [ "${XDG_CURRENT_DESKTOP}" = 'i3' ]; then
i3-msg exit
else
## xfce hook
#xfce4-session-logout
echo "Unsupported desktop: Add it here, along with the logout hook"
fi
}
## Start chromium with special hooks
## Browse:
## Optional Option: --host-resolver-rules='MAP * ~NOTFOUND , EXCLUDE localhost'
helper_browse() {
chromium --user-agent="${DEFAULT_USER_AGENT}" --js-flags=--jitless --proxy-server="${OUTLINE_LOCAL}"
}
helper_browse_temp() {
chromium --user-data-dir="${path_tmp}" --disk-cache-dir="${path_tmp}" --user-agent="${DEFAULT_USER_AGENT}" --js-flags=--jitless --proxy-server="${OUTLINE_LOCAL}"
}
helper_browse_with_alt_proxy() {
chromium --user-data-dir="${path_tmp}" --disk-cache-dir="${path_tmp}" --user-agent="${DEFAULT_USER_AGENT}" --js-flags=--jitless --proxy-server="${OUTLINE_LOCAL_FILTERED}"
}
## Inquisitor
helper_edit_inquisitor() {
"${EDITOR_RICH}" "${ENDPOINT_INQUISITOR}"
}
## pactl sources
helper_get_available_pactl_source() {
if [ -z "${1}" ]; then
pactl list sources
else
## get an available source
pactl list sources | grep "${1}"
fi
}
## git
helper_git_safe_directory() {
git config --global --add safe.directory "$(pwd)"
}
helper_git_safe_directory_auto() {
git config --global --add safe.directory "$(pwd)"
git init
git add .
printf "Commit details: \n"
read -r commitDetails
printf "summary: git commit -m "%s"\n" "${commitDetails}"
git commit -m "$(printf '"%s"' "$commitDetails")"
}
## sed:: Replace a value in a file, on each occurance within an entire directory,
## with another value for each occurance
helper_replace_string_dir() {
if [ -z "${1}" ]; then
echo "You must provide a replacement value, and a replace with value."
echo "Format:"
echo "helper_replace_string_dir 'REPLACEMENT_VALUE_HERE' 'REPLACE_WITH_VALUE_HERE'"
else
if [ -z "${2}" ]; then
echo "You must provide a replacement value, and a replace with value."
echo "Format:"
echo "helper_replace_string_dir 'REPLACEMENT_VALUE_HERE' 'REPLACE_WITH_VALUE_HERE'"
## If the conditions are passed, move forward
else
REPLACEMENT_VALUE="${1}"
REPLACE_WITH="${2}"
for i in -exec "find *" ; do sed -i -- "s/## ${REPLACEMENT_VALUE}/## ${REPLACE_WITH}/g" "${i}"; done
fi
fi
}
## screen recorder
helper_screen_recorder_utility() {
cat << EOF
-------------------------------
screen recording utility: Available options
-------------------------------
Implied Package Sub-system: ${CONFIGURATION_DEFAULT_SCREENRECORD_CONTEXT}
record -> Default screen recording utility
record a x-y window space by first selecting the window to begin recording
record <NAME_HERE> -> Custom screen recording name
record a x-y window space by first naming the destination file, then
selecting a window to begin recording
record <NAME_HERE> <FORMAT_HERE> -> Custom screen recording name and format
record a x-y window space by first naming the destination file, setting
the format (mp4, mkv), then selecting a window to begin recording
record <NAME> <FORMAT> <AUDIO_DRIVER> -> Customize the audio driver
record a x-y window space by first naming the destination file, setting
the format (mp4, mkv), and specifying the audio driver to be used within
the recording - then selecting a window to begin recording
--------------------------------
EOF
}
## sway
helper_sway_get_tree() {
swaymsg -t get_tree
}
helper_sway_get_tree_active() {
swaymsg -t get_tree | jq -r '..|try select(.focused == true)'
}
helper_sway_get_tree_option() {
if [ -z "${1}" ]; then
## Fall back to the generic helper
helper_sway_get_tree
else
## Pass the option
case "${1}" in
app_id|class|current_workspace|foreign_toplevel_id|instance|pid|shell|title)
swaymsg -t get_tree | grep "${1}"
;;
*)
printf "Available options are app_id, class, current_workspace, foreign_toplevel_id, instance, pid, shell, title\n"
;;
esac
fi
}
helper_sway_get_tree_option_all() {
if [ -z "${1}" ]; then
## Fall back to the generic helper
helper_sway_get_tree
else
## Pass the option
case "${1}" in
app_id|class|current_workspace|foreign_toplevel_id|instance|pid|shell|title)
swaymsg -t get_tree | grep -A5 "${1}"
;;
*)
printf "Available options are app_id, class, current_workspace, foreign_toplevel_id, instance, pid, shell, title\n"
;;
esac
fi
}
helper_sway_get_tree_dump_all() {
## Dump the entire sway tree information chain
swaymsg -t get_tree | jq -r 'recurse(.nodes[])'
}
helper_sway_get_tree_dump_floating() {
## Dump the floating sway tree information chain
swaymsg -t get_tree | jq -r 'recurse(.nodes[], .floating_nodes[])'
}
helper_sway_get_tree_dump_type() {
if [ -z "${1}" ]; then
## Fall back to the generic helper
helper_sway_get_tree
else
## Pass the option
case "${1}" in
con|workspace)
## Dump the sway tree type
swaymsg -t get_tree | jq -r 'recurse(.nodes[], .floating_nodes[]) | select(.type == "'"${1}"'")'
;;
*)
printf "Available options are con, workspace\n"
;;
esac
fi
}
helper_sway_get_tree_program() {
if [ -z "${1}" ]; then
## Fall back to the generic helper
helper_sway_get_tree
else
## Look for the program
swaymsg -t get_tree | grep "${1}"
fi
}
## helper_test_*
helper_test_network_nc() {
if [ -z "${1}" ] && [ -z "${2}" ]; then
## Fall back to the last session
printf "You need to provide a network address and port number\n"
printf "helper_test_network_nc <NETWORK_ADDRESS> <PORT_NUMBER>\n"
else
## Look for a specific network and port address
nc -zv "${1}" "${2}"
fi
}
## helper_view_*
helper_view_journal() {
journalctl
}
## helper_view_*
helper_view_journal_current_session() {
journalctl -xe
}
## helper_view_*
helper_view_journal_previous_session() {
if [ -z "${1}" ]; then
## Fall back to the last session
journalctl -b -1
else
## Look for a specific session in the past
journalctl -b -"${1}"
fi
}
## helper_view_*
helper_view_network_ss() {
if [ -z "${1}" ] && [ -z "${2}" ]; then
## Fall back to the last session
printf "You need to provide a port number to evaluate\n"
printf "helper_view_network_ss <PORT_NUMBER>\n"
else
## Look for a specific network and port address
ss -tulpen | grep :"${1}"
fi
}
###############################################################################
## User-space utilities
###############################################################################
## screen_record
perform_screen_record() {
screen_record_astream() {
printf "%b--------------------------------------------------------------------\n" "${tmodReset}"
printf "Recording (screen: %s): %b%s%b\n" "${2}" "${tmodLabelHeading}" "${1}" "${tmodReset}"
printf "drive: %s\n" "${3}"
printf "%b--------------------------------------------------------------------\n" "${tmodReset}"
printf "press ctrl+c to exit the screen recording\n"
printf "%b--------------------------------------------------------------------\n" "${tmodReset}"
$CONFIGURATION_DEFAULT_SCREENRECORD_PROGRAM $CONFIGURATION_DEFAULT_SCREEN_GLOB "$($CONFIGURATION_DEFAULT_SCREEN_VACUUM)" "${CONFIGURATION_DEFAULT_SCREEN_AUDIO}${3}" $CONFIGURATION_DEFAULT_SCREENRECORD_FILE "${1}"."${2}"
printf "%b--------------------------------------------------------------------\n" "${tmodReset}"
}
if [ -z "${1}" ]; then
## Default to the generic screen record name
screen_record_astream "${CONFIGURATION_DEFAULT_SCREEN_RECORD_NAME}" "${CONFIGURATION_DEFAULT_SCREEN_RECORD_FORMAT}" "${CONFIGURATION_DEFAULT_SCREEN_RECORD_AUDIO_DRIVER}"
else
if [ -z "${2}" ]; then
if [ "${1}" = "--help" ] || [ "${1}" = "-help" ]; then
helper_screen_recorder_utility
else
STREAM_NAME="${1}"
## default to generic audio driver and video quality format: localize
screen_record_astream "${STREAM_NAME}" "${CONFIGURATION_DEFAULT_SCREEN_RECORD_FORMAT}" "${CONFIGURATION_DEFAULT_SCREEN_RECORD_AUDIO_DRIVER}"
fi
else
if [ -z "${3}" ]; then
STREAM_NAME="${1}"
STREAM_FORMAT="${2}"
## default to generic audio driver: localize
screen_record_astream "${STREAM_NAME}" "${STREAM_FORMAT}" "${CONFIGURATION_DEFAULT_SCREEN_RECORD_AUDIO_DRIVER}"
else
STREAM_NAME="${1}"
STREAM_FORMAT="${2}"
STREAM_AUDIO_DRIVER="${3}"
## default to full override on defaults: setting the stream name, format, and audio driver
screen_record_astream "${STREAM_NAME}" "${STREAM_FORMAT}" "${STREAM_AUDIO_DRIVER}"
fi
fi
fi
}
###############################################################################
## Empty Factories
###############################################################################
perform_instance_factory() {
## Provide a failed REOPERTE instance
export FAILED_REOPERATE=0
unit_temp_file="tmp_file_XYZ100.txt"
## Counter
counter_operations=0
## Control Stack
IFS=","
set -- "$@"
z_check="${1}"
nth_check="${2}"
#printf "ValueS is-> %s\n" "${ValueS}"
if [ "${TRINE_CONTROL_VERBOSE}" == "1" ] || [ "${TRINE_CONTROL_VERBOSE}" -eq 1 ]; then
trine_control_value_check "pif" "$*"
trine_control_value_expansion "${1}" "${2}"
else
:
fi
if [ -n "${z_check}" ] && [ -n "${nth_check}" ]; then
## Currently activating a glob
if [ "${TRINE_CONTROL_VERBOSE}" == "1" ] || [ "${TRINE_CONTROL_VERBOSE}" -eq 1 ]; then
trine_control_glob "activated"
else
:
fi
glob_construct() {
## Context-switch
export ARG="${1}"
if [ -z "${ARG}" ]; then
if [ "${TRINE_CONTROL_VERBOSE}" == "1" ] || [ "${TRINE_CONTROL_VERBOSE}" -eq 1 ]; then
trine_control_glob "exhausted"
else
:
fi
else
if [ "${TRINE_CONTROL_VERBOSE}" == "1" ] || [ "${TRINE_CONTROL_VERBOSE}" -eq 1 ]; then
trine_control_item "${ARG}"
else
:
fi
if [ "${counter_operations}" -eq 0 ] && [ "${ARG}" = "-R" ]; then
:
else
:
fi
## You may choose to use a sudo lock/starter
## Don't evaluate the -R instance, or any other special operators, such as a custom <<CONTEXT>> schema
if [ "${ARG}" = "-R" ]; then
:
else
## [X] Special Operations always have more than 2 arguments: Either a glob, or a custom <<CONTEXT>>
## Globs always present like this: pif <CUSTOM_CONTEXT> <> <>
## Check for position 3rd in the updated/shifted list
if [ -n "${3}" ]; then
if [ -f 'tmp_file_YXZ100.txt' ]; then
:
else
perform_creation_file "${unit_temp_file}" ;
fi
fi
## COMPLEX LOGIC HERE ##
## X X XX XX XX X X ##
fi
fi
}
while
glob_construct "$@"
counter_operations=$((counter_operations+1))
shift 1
do
: ;
done
## [X] Working
## If no additional target is supplied with -R
elif [ -n "${z_check}" ]; then
if [ "${z_check}" = "-R" ]; then
echo "You need to supply a instance for the -R default <CONTEXT> operation to be applied to."
echo "Example: pif -R <INSTANCE_TO_APPLY_<<CONTEXT>>_CHANGE_TO>"
else
if [ -f "${z_check}" ]; then
determine_mint_logic "<<CONTEXT>>" "GENERIC_<<CONTEXT>>_FILE" "${z_check}" ;
printf "<mod:o:g:f> %b%s%b -> %b%s%b\n" "${tmodSuccess}" "${z_check}" "${tmodReset}" "${tmodLabelCustomSED}" "GENERIC_<<CONTEXT>>_FILE" "${tmodReset}"
elif [ -d "${z_check}" ]; then
determine_mint_logic "<<CONTEXT>>" "GENERIC_<<CONTEXT>>_DIRECTORY" "${z_check}" ;
printf "<mod:o:g:d> %b%s%b -> %b%s%b\n" "${tmodSuccess}" "${z_check}" "${tmodReset}" "${tmodLabelCustomSED}" "GENERIC_<<CONTEXT>>_DIRECTORY" "${tmodReset}"
else
echo "That instance doesn't exist. Try another one that's valid."
fi
fi
elif [ -z "${z_check}" ]; then
## No arguements supplied
echo "You haven't supplied anything to modify the owner for."
else
echo "Unsupported ownership modification operations."
fi
}
###############################################################################
## Media extensions
###############################################################################
## astream
perform_astream() {
printf "%b--------------------------------------------------------------------\n" "${tmodReset}"
astream_highest_quality() {
printf "Assembling stream (Highest-quality): %b%s%b\n" "${tmodLabelHeading}" "${1}" "${tmodReset}"
printf "%b--------------------------------------------------------------------\n" "${tmodReset}"
$CONFIGURATION_DEFAULT_ASTREAMER $CONFIGURATION_DEFAULT_ASTREAM_FORCE "${CONFIGURATION_ASTREAM_CONTEXT_HQ}" "${1}"
}
if [ -z "${1}" ]; then
echo "You must provide a url to use astreamer with"
echo "Format:"
echo "https://<STREAM_TO_ASSEMBLE_HERE>"
else
if [ -z "${2}" ]; then
ASTREAM_VALUE="${1}"
## default to high quality stream: localize
astream_highest_quality "${ASTREAM_VALUE}"
else
if [ "${2}" = "--low" ]; then
ASTREAM_VALUE="${1}"
printf "Assembling stream (Standard-quality): %b%s%b\n" "${tmodLabelHeading}" "${1}" "${tmodReset}"
printf "%b--------------------------------------------------------------------\n" "${tmodReset}"
## fallback to standard astream
$CONFIGURATION_DEFAULT_ASTREAMER "${ASTREAM_VALUE}"
else
## default to high quality stream: localize
astream_highest_quality "${ASTREAM_VALUE}"
fi
fi
fi
}
###############################################################################
## STATE
###############################################################################
## CUSTOM NETWORK MANAGEMENT UP and DOWN
STATE_NETWORKMANAGER_UP() {
perform_system_action "systemctl" "start" "NetworkManager"
}
STATE_NETWORKMANAGER_DOWN() {
perform_system_action "systemctl" "stop" "NetworkManager"
}