Hirdetés

Hozzászólok Aktív témák

  • AtHoS

    nagyúr

    válasz AtHoS #784 üzenetére

    Még annyit hozzátennék, hátha r0by is kielégítő választ talál a kérdéseire, hogy a letöltött FW zip fájl tartalmaz egy README-merlin.txt szöveges fájlt. Már korábban is láttam, hogy extra információk is vannak benne, amit jó lenne átböngészni a megfelelő beüzemeléshez.

    Nos, most, hogy r0by írta nem futottak le a scriptek Jffs-ből, kicsit belenéztem, hogy FW szinten mennyire van korlátozva milyen scriptek is lehetnek a /Jffs/scripts/ útvonalon. Ahogy kiszűrtem, akármilyen script futása nincs is engedélyezve. Kiemeltem a szövegfájlból az ide vonatkozó részt:

    ** User scripts **
    These are shell scripts that you can create, and which will be run when
    certain events occur. Those scripts must be saved in /jffs/scripts/
    (so, JFFS must be enabled and formatted). Available scripts:

    * dhcpc-event: Called whenever a DHCP event occurs on the WAN
    interface. The type of event (bound, release, etc...)
    is passed as an argument.
    * firewall-start: Firewall is started (filter rules have been applied)
    The WAN interface will be passed as argument (for
    example. "eth0")
    * init-start: Right after jffs is mounted, before any of the services
    get started
    * nat-start: nat rules (i.e. port forwards and such) have been applied
    (nat table)
    * post-mount: Just after a partition is mounted
    * pre-mount: Just before a partition is mounted. Be careful with
    this script. This is run in a blocking call and will
    block the mounting of the partition for which it is
    invoked till its execution is complete. This is done so
    that it can be used for things like running e2fsck on the
    partition before mounting. This script is also passed the
    device path being mounted as an argument which can be
    used in the script using $1.
    * qos-start: Called after both the iptables rules and tc configuration
    are completed for QoS.
    * openvpn-event: Called whenever an OpenVPN server gets
    started/stopped, or an OpenVPN client connects to a
    remote server. Uses the same syntax/parameters as
    the "up" and "down" scripts in OpenVPN.
    * services-start: Initial service start at boot
    * services-stop: Services are stopped at shutdown/reboot
    * unmount: Just before unmounting a partition. This is a blocking
    script, so be careful with it. The mount point is passed
    as an argument to the script.
    * wan-start: WAN interface just came up (includes if it went down and
    back up). The WAN unit number will be passed as argument
    (0 = primary WAN)

    Don't forget to set them as executable:

    chmod a+rx /jffs/scripts/*

    And like any Linux script, they need to start with a shebang:

    #!/bin/sh

    Ami még érdekes lehet a szövegfájlból, hogy saját konfig fájlokat is lehet alkalmazni a szolgáltatásokhoz, melyeket a /Jffs/config/ útvonalon kell elhelyezni. Idézet a kérdéses szövegfájlból:

    ** Customized config files **
    The services executed by the router such as minidlna or dnsmasq relies
    on dynamically-generated config files. There are various methods
    through which you can interact with these config scripts to customize
    them.

    The first method is through custom configs. You can append content to
    various configuration files that are created by the firmware, or even
    completely replace them with custom config files you have created.
    Those config override files must be stored in /jffs/configs/. To have
    a config file appended to the one created by the firmware, simply add
    ".add" at the end of the file listed below. For example,
    /jffs/configs/dnsmasq.conf.add will be added at the end of the dnsmasq
    configuration file that is created by the firmware, while
    /jffs/configs/dnsmasq.conf would completely replace it.

    Note that replacing a config file with your own implies that you
    properly fill in all the fields usually dynamically created by the
    firmware. Since some of these entries require dynamic parameters, you
    might be better using the postconf scripts added in 374.36 (see the
    postconf scripts section below).

    The list of available config overrides:

    * dhcp6s.conf
    * dnsmasq.conf
    * exports (only exports.add supported)
    * fstab (only fstab supported, remember to create mount point
    through init-start first if it doesn't exist!)
    * group, gshadow, passwd, shadow (only .add versions supported)
    * hosts (for /etc/hosts)
    * minidlna.conf
    * pptpd.conf
    * profile (shell profile, only profile.add suypported)
    * radvd.conf
    * smb.conf
    * snmpd.conf
    * vsftpd.conf
    * upnp (for miniupnpd)

    Also, you can put OpenVPN ccd files in the following directories:

    /jffs/configs/openvpn/ccd1/
    /jffs/configs/openvpn/ccd2/

    The content of these will be copied to their respective
    server instance's ccd directory when the server is started.

    Van még itt postconfig és egyéb nyalánkságokra is infó, szóval át kell ezt tüzetesebben is vizsgálni, ha valaki szeretne mélyebben belenyúlni a dolgokba

    Viszont a Jffs-re írt jó tanács
    This space will survive reboots (but it
    *MIGHT NOT survive firmware flashing*, so back it up first before
    flashing!).

    valószínű nem működik, ugyanis én biztosan nem mentettem le frissítés előtt a Jffs tartalmát, mégis megmaradt minden ott lévő script és azokban az előző saját beleszerkesztésem (pl. a firewall-start -ba a portnyitás rtorrent részére).

    [ Szerkesztve ]

    Vistaboy: "Nem kell, ugyanis nem lesz DNF-em. A demó alapján felejtős" válasz rá KKaresz45-től: "Ez van, ha gyorsan összecsapnak valamit"

Hozzászólok Aktív témák

Hirdetés