Browse Source

Installation of inadyn within images

Bob Mottram 6 years ago
parent
commit
f3e0653908
2 changed files with 14 additions and 19 deletions
  1. 10
    12
      src/freedombone-image-customise
  2. 4
    7
      src/freedombone-utils-web

+ 10
- 12
src/freedombone-image-customise View File

1657
         mkdir -p "$rootdir/root/build"
1657
         mkdir -p "$rootdir/root/build"
1658
     fi
1658
     fi
1659
     chroot "$rootdir" apt-get -yq install build-essential curl libgnutls28-dev automake1.11 libconfuse-dev
1659
     chroot "$rootdir" apt-get -yq install build-essential curl libgnutls28-dev automake1.11 libconfuse-dev
1660
+    chroot "$rootdir" apt-get -yq install gnutls-dev libconfuse-dev
1660
 
1661
 
1661
     if [ -d /repos/inadyn ]; then
1662
     if [ -d /repos/inadyn ]; then
1662
         mkdir "$rootdir/root/build/inadyn"
1663
         mkdir "$rootdir/root/build/inadyn"
1677
     cd "$rootdir/root/build/inadyn" || exit 24682464628
1678
     cd "$rootdir/root/build/inadyn" || exit 24682464628
1678
     { echo '#!/bin/bash';
1679
     { echo '#!/bin/bash';
1679
       echo 'cd ~/build/inadyn';
1680
       echo 'cd ~/build/inadyn';
1680
-      echo '#./autogen.sh';
1681
-      echo './configure';
1682
-      echo 'USE_OPENSSL=1 make';
1683
-      echo 'make install'; } > "$rootdir/root/build/build_inadyn.sh"
1681
+      echo './autogen.sh';
1682
+      echo './configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --enable-openssl';
1683
+      echo 'make -j5';
1684
+      echo 'make install-strip'; } > "$rootdir/root/build/build_inadyn.sh"
1684
     chmod +x "$rootdir/root/build/build_inadyn.sh"
1685
     chmod +x "$rootdir/root/build/build_inadyn.sh"
1685
     chroot "$rootdir" /root/build/build_inadyn.sh
1686
     chroot "$rootdir" /root/build/build_inadyn.sh
1686
-    if [ ! -f "$rootdir/usr/local/sbin/inadyn" ]; then
1687
+    if [ ! -f "$rootdir/usr/sbin/inadyn" ]; then
1687
         echo 'Failed to build inadyn'
1688
         echo 'Failed to build inadyn'
1688
         exit 6209356
1689
         exit 6209356
1689
     fi
1690
     fi
1690
 
1691
 
1691
     # create a configuration file
1692
     # create a configuration file
1692
-    { echo 'background';
1693
-      echo 'verbose        1';
1694
-      echo 'period         300';
1695
-      echo 'startup-delay  60';
1696
-      echo 'cache-dir      /run/inadyn';
1697
-      echo 'logfile        /dev/null'; } > "$rootdir/etc/inadyn.conf"
1693
+    { echo 'period          = 300';
1694
+      echo 'user-agent      = Mozilla/5.0';
1695
+      echo ''; } > "$rootdir/etc/inadyn.conf"
1698
     chmod 600 "$rootdir/etc/inadyn.conf"
1696
     chmod 600 "$rootdir/etc/inadyn.conf"
1699
 
1697
 
1700
     { echo '[Unit]';
1698
     { echo '[Unit]';
1702
       echo 'After=network.target';
1700
       echo 'After=network.target';
1703
       echo '';
1701
       echo '';
1704
       echo '[Service]';
1702
       echo '[Service]';
1705
-      echo 'ExecStart=/usr/local/sbin/inadyn --config /etc/inadyn.conf';
1703
+      echo 'ExecStart=/usr/sbin/inadyn --config /etc/inadyn.conf';
1706
       echo 'Restart=always';
1704
       echo 'Restart=always';
1707
       echo 'Type=forking';
1705
       echo 'Type=forking';
1708
       echo '';
1706
       echo '';

+ 4
- 7
src/freedombone-utils-web View File

535
     fi
535
     fi
536
 
536
 
537
     # create a configuration file
537
     # create a configuration file
538
-    { echo 'background';
539
-      echo 'verbose        1';
540
-      echo 'period         300';
541
-      echo 'startup-delay  60';
542
-      echo 'cache-dir      /run/inadyn';
543
-      echo 'logfile        /dev/null'; } > "${INADYN_CONFIG_FILE}"
538
+    { echo 'period          = 300';
539
+      echo 'user-agent      = Mozilla/5.0';
540
+      echo ''; } > "${INADYN_CONFIG_FILE}"
544
     chmod 600 "${INADYN_CONFIG_FILE}"
541
     chmod 600 "${INADYN_CONFIG_FILE}"
545
 
542
 
546
     { echo '[Unit]';
543
     { echo '[Unit]';
554
       echo '';
551
       echo '';
555
       echo '[Install]';
552
       echo '[Install]';
556
       echo 'WantedBy=multi-user.target'; } > /etc/systemd/system/inadyn.service
553
       echo 'WantedBy=multi-user.target'; } > /etc/systemd/system/inadyn.service
557
-    systemctl enable inadyn
558
     systemctl daemon-reload
554
     systemctl daemon-reload
555
+    systemctl enable inadyn
559
     systemctl start inadyn
556
     systemctl start inadyn
560
 
557
 
561
     # Remove old version of inadyn
558
     # Remove old version of inadyn