@@ -598,17 +598,21 @@ phase2()
598
598
# todo: embed version to build and ask/check version before build
599
599
600
600
if [ ! -r ${distdir} /misc/sipcalc ]; then
601
- if [ -f ${distdir} /misc/src/sipcalc/Makefile ]; then
602
- make -C ${distdir} /misc/src/sipcalc
603
- installne " -o ${cbsduser} -g ${cbsduser} -m 555 -s" ${distdir} /misc/src/sipcalc/sipcalc ${distdir} /misc/sipcalc
604
- make -C ${distdir} /misc/src/sipcalc clean
601
+ if [ ! -x ${distdir} /misc/sipcalc5 ]; then
602
+ if [ -f ${distdir} /misc/src/sipcalc/Makefile ]; then
603
+ make -C ${distdir} /misc/src/sipcalc
604
+ installne " -o ${cbsduser} -g ${cbsduser} -m 555 -s" ${distdir} /misc/src/sipcalc/sipcalc ${distdir} /misc/sipcalc
605
+ make -C ${distdir} /misc/src/sipcalc clean
606
+ fi
605
607
fi
606
608
fi
607
609
608
610
if [ -f ${distdir} /misc/src/cbsd_md5/Makefile ]; then
609
- make -C ${distdir} /misc/src/cbsd_md5
610
- installne " -o ${cbsduser} -g ${cbsduser} -m 555 -s" ${distdir} /misc/src/cbsd_md5/cbsd_md5 ${distdir} /misc/cbsd_md5
611
- make -C ${distdir} /misc/src/cbsd_md5 clean
611
+ if [ ! -x ${distdir} /misc/cbsd_md5 ]; then
612
+ make -C ${distdir} /misc/src/cbsd_md5
613
+ installne " -o ${cbsduser} -g ${cbsduser} -m 555 -s" ${distdir} /misc/src/cbsd_md5/cbsd_md5 ${distdir} /misc/cbsd_md5
614
+ make -C ${distdir} /misc/src/cbsd_md5 clean
615
+ fi
612
616
fi
613
617
614
618
if [ ! -f ${distdir} /misc/ipv6range ]; then
@@ -913,7 +917,7 @@ phase5()
913
917
exit 1
914
918
fi
915
919
916
- ${CHMOD_CMD} 0660 ${dbdir} /inv.${nodename} .sqlite && ${CHOWN_CMD} ${cbsduser} :${cbsduser} ${dbdir} /inv.${nodename} .sqlite
920
+ ${CHMOD_CMD} 0660 ${dbdir} /inv.${nodename} .sqlite ${workdir} /nc.inventory && ${CHOWN_CMD} ${cbsduser} :${cbsduser} ${dbdir} /inv.${nodename} .sqlite ${workdir} /nc.inventory
917
921
918
922
env workdir=${workdir} /usr/local/bin/cbsd ${miscdir} /updatesql ${dbdir} /inv.${nodename} .sqlite ${distdir} /share/local-local.schema local
919
923
env workdir=${workdir} /usr/local/bin/cbsd ${miscdir} /updatesql ${dbdir} /inv.${nodename} .sqlite ${distdir} /share/local-carp.schema carp
@@ -1514,7 +1518,7 @@ EOF
1514
1518
1515
1519
desc_question " preseedinit"
1516
1520
if [ $? -eq 0 -a " ${answ} " = " 1" ]; then
1517
- cp ${INITCFG_PRESEED} /tmp/prs.txt
1521
+ ${CP_CMD} ${INITCFG_PRESEED} /tmp/prs.txt
1518
1522
1519
1523
echo
1520
1524
echo " ---cut here ---"
@@ -1523,11 +1527,40 @@ EOF
1523
1527
echo
1524
1528
1525
1529
fi
1526
- rm -f ${INITCFG_PRESEED}
1530
+ ${RM_CMD} -f ${INITCFG_PRESEED}
1527
1531
1528
1532
/usr/local/cbsd/misc/cbsdsysrc -qf ${workdir} /rc.conf preseedinit=" ${answ} " > /dev/null 2>&1
1529
1533
fi
1530
1534
1535
+ if [ ${first_init} -eq 1 ]; then
1536
+ [ -r /etc/rc.conf ] && . /etc/rc.conf
1537
+ if [ " ${cbsdd_enable} " = " YES" ]; then
1538
+ printf " Starting service: cbsdd ... "
1539
+ case " ${platform} " in
1540
+ Linux)
1541
+ [ -z " ${SYSTEMCTL_CMD} " ] && echo " no systemctl cmd" && break
1542
+ ${SYSTEMCTL_CMD} stop cbsdd.service > /dev/null 2>&1 || true
1543
+ ${SYSTEMCTL_CMD} start cbsdd.service > /dev/null 2>&1
1544
+ _ret=$?
1545
+ ;;
1546
+ * )
1547
+ [ -z " ${SERVICE_CMD} " ] && echo " no service cmd" && break
1548
+ ${SERVICE_CMD} cbsdd stop > /dev/null 2>&1 || true
1549
+ ${SERVICE_CMD} cbsdd start > /dev/null 2>&1
1550
+ _ret=$?
1551
+ ;;
1552
+ esac
1553
+ case " ${_ret} " in
1554
+ 0)
1555
+ ${ECHO} " ${N2_COLOR} done${N0_COLOR} "
1556
+ ;;
1557
+ 1)
1558
+ ${ECHO} " ${W1_COLOR} failed${N0_COLOR} "
1559
+ ;;
1560
+ esac
1561
+ fi
1562
+ fi
1563
+
1531
1564
exit 0
1532
1565
}
1533
1566
@@ -1655,7 +1688,7 @@ case "${platform}" in
1655
1688
true
1656
1689
;;
1657
1690
FreeBSD)
1658
- MAIN_EXTRA_CMD=" ${MAIN_EXTRA_CMD} kldstat pw"
1691
+ MAIN_EXTRA_CMD=" ${MAIN_EXTRA_CMD} kldstat pw service "
1659
1692
;;
1660
1693
esac
1661
1694
0 commit comments