What's new

DNScrypt dnscrypt installer for asuswrt

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

I do know that, thus the BLAH var in my example simply contains that HTML and ${#BLAH} should have returned only the length as on my platform. Instead on yours there's a <! prefix . I also used this notation ${#VAR} in another place and it works right there, so I guess this is a bug in the shell. Do you have any comment?
 
@thelonelycoder do you know why there's <! for ${#VAR} anyway on your router?
Maybe a typo:
Code:
BLAH="$(curl -L -k -s http://download.dnscrypt.info/resolvers-list/v2/public-resolvers.md)"
echo "${#BLAH}"
[ "${#BLAH}" -eq "32" ] || echo BAM
[ "$(echo $BLAH|wc -c)" -eq "32" ] || echo HAM
Result:
Code:
user@RT-AC86U-AD60:/tmp/home/root# qtest.sh
16757
BAM
HAM
 
I do know that, thus the BLAH var in my example simply contains that HTML and ${#BLAH} should have returned only the length as on my platform. Instead on yours there's a <! prefix . I also used this notation ${#VAR} in another place and it works right there, so I guess this is a bug in the shell. Do you have any comment?
Directory listing, there's no public-resolvers.md.md5sum:
Code:
Index of /dnscrypt-resolvers/v2/

../
minisign.pub                                       07-Feb-2018 12:31                 128
opennic.md                                         07-Feb-2018 12:31                2319
opennic.md.minisig                                 07-Feb-2018 12:31                 298
parental-control.md                                07-Feb-2018 12:31                1186
parental-control.md.minisig                        07-Feb-2018 12:31                 307
public-resolvers.md                                07-Feb-2018 12:31               16758
public-resolvers.md.minisig
 
You misunderstood my use for these md5sum files. These are remote files contains md5sum for the actual files without md5sum extension. This way I can make sure I only download if there's newer file. This is for my github repo of course, for the download.dnscrypt.info domain, there's no md5sum file and a new file should always be downloaded each time, as the md5sum download is either empty 404 or whatever returned by the server, obviously it won't be 32 byte and match any file on the device.

The problem here is when the length of a var is big enough, the shell on 86U appends <! before the result. Weird.
 
I do know that, thus the BLAH var in my example simply contains that HTML and ${#BLAH} should have returned only the length as on my platform. Instead on yours there's a <! prefix . I also used this notation ${#VAR} in another place and it works right there, so I guess this is a bug in the shell. Do you have any comment?
This:
Code:
BLAH=`curl -L -k -s http://download.dnscrypt.info/resolvers-list/v2/public-resolvers.md`
echo ${#BLAH}
[ ${#BLAH} -eq 32 ] || echo BAM
[ `echo $BLAH|wc -c` -eq 32 ] || echo HAM
And proper POSIX:
Code:
BLAH="$(curl -L -k -s http://download.dnscrypt.info/resolvers-list/v2/public-resolvers.md)"
echo ${#BLAH}
[ "${#BLAH}" -eq "32" ] || echo BAM
[ "$(echo $BLAH|wc -c)" -eq "32" ] || echo HAM
Return the same for me: 16757
 
You misunderstood my use for these md5sum files. These are remote files contains md5sum for the actual files without md5sum extension. This way I can make sure I only download if there's newer file. This is for my github repo of course, for the download.dnscrypt.info domain, there's no md5sum file and a new file should always be downloaded each time, as the md5sum download is either empty 404 or whatever returned by the server, obviously it won't be 32 byte and match any file on the device.

The problem here is when the length of a var is big enough, the shell on 86U appends <! before the result. Weird.
I see, ignore my previous posts then.
 
@bigeyes0x0 yup, on my 1900P:
Code:
ASUSWRT-Merlin RT-AC68U 384.3-beta1 Sun Feb  4 17:53:07 UTC 2018
user@RT-AC1900P:/tmp/home/root# qtest.sh
267752
BAM
HAM
 
IS THIS A BUG? I'm annoyed :mad:.
Here, that works for both routers I tested it with:
Code:
BLAH="$(curl -L -k -s http://download.dnscrypt.info/resolvers-list/v2/public-resolvers.md.md5sum)"
echo $(echo ${#BLAH} | sed 's/<!//')
[ "$(echo ${#BLAH} | sed 's/<!//')" -eq "32" ] || echo BAM
[ "$(echo $BLAH|wc -c)" -eq "32" ] || echo HAM
 
Code:
user@RT-AC86U-AD60:/tmp/home/root# qtest.sh
267752
BAM
HAM
Code:
user@RT-AC1900P:/tmp/home/root# qtest.sh
267752
BAM
HAM
 
@thelonelycoder Haha, thanks for following up. I have actually worked around it already as you have run the installer successfully in one of your previous posts. I use the wc -c method. In any case, I wonder if it's a bug and if it is maybe it should be fixed. The shell is quite important after all.
 
Interesting,
@thelonelycoder Haha, thanks for following up. I have actually worked around it already as you have run the installer successfully in one of your previous posts. I use the wc -c method. In any case, I wonder if it's a bug and if it is maybe it should be fixed. The shell is quite important after all.
Yup, echo $(echo $BLAH|wc -c) returns 267732
 
curl -L -k -s http://download.dnscrypt.info/resolvers-list/v2/public-resolvers.md.md5sum
resolves to the html file of https://dnscrypt.info/ which is css and html code only.
I only see some css matching md5 in it.

Yeah, I warned him already, aside the fact that the dnscrypt author's use .md5s nomore
Also I don't quite understand what bigeyes tryes to achieve with such command ...

If you want to check for remote checksum:

Code:
x=curl -L -k -s [url] | md5sum | awk {'print $1}'
y=m5sum [localfile] | awk {'print $1}'
 
When you reboot the router, does syslog gives you any clues why it won't mount your usb drive?
Routers working fine hence the pics of the network shares etc.
I rebooted an hour ago and it shows this.

Feb 7 20:10:10 kernel: sd 0:0:0:0: [sda] 30464000 512-byte logical blocks: (15.5 GB/14.5 GiB)
Feb 7 20:10:10 kernel: sd 0:0:0:0: [sda] Write Protect is off
Feb 7 20:10:10 kernel: sd 0:0:0:0: [sda] Mode Sense: 43 00 00 00
Feb 7 20:10:10 kernel: sd 0:0:0:0: [sda] Assuming drive cache: write through
Feb 7 20:10:10 kernel: sd 0:0:0:0: [sda] Assuming drive cache: write through
Feb 7 20:10:10 kernel: sda: sda1
Feb 7 20:10:10 kernel: sd 0:0:0:0: [sda] Assuming drive cache: write through
Feb 7 20:10:10 kernel: sd 0:0:0:0: [sda] Attached SCSI removable disk
Feb 7 20:12:12 kernel: EXT3-fs: barriers not enabled
Feb 7 20:12:12 hotplug[689]: USB ext3 fs at /dev/sda1 mounted on /tmp/mnt/16GB
Feb 7 20:12:12 usb: USB ext3 fs at /dev/sda1 mounted on /tmp/mnt/16GB.
Feb 7 20:12:12 kernel: kjournald starting. Commit interval 5 seconds
Feb 7 20:12:12 kernel: EXT3-fs (sda1): using internal journal
Feb 7 20:12:12 kernel: EXT3-fs (sda1): mounted filesystem with ordered data mode
Feb 7 20:12:12 disk_monitor: be idle
 
It does seem to mount indeed, at least initially, but I can't figure out why it didn't show up in df -h...

If there's nothing else on the drive, try running (from a terminal) the following code (before the #):

Code:
umount /tmp/mnt/16GB #assuming it is still somehow mounted
e2fsck -fpv /dev/sda1 #this will run a forced filecheck on the partition, automatically repair if possible without user input and output verbose

and please post the output.
 
It does seem to mount indeed, at least initially, but I can't figure out why it didn't show up in df -h...

If there's nothing else on the drive, try running (from a terminal) the following code (before the #):

Code:
umount /tmp/mnt/16GB #assuming it is still somehow mounted
e2fsck -fpv /dev/sda1 #this will run a forced filecheck on the partition, automatically repair if possible without user input and output verbose

and please post the output.


Code:
GoNz0@Router:/tmp/home/root# umount /tmp/mnt/16GB
GoNz0@Router:/tmp/home/root#

Feb 7 23:00:12 disk_monitor: Got SIGALRM...
Feb 7 23:03:42 kernel: [tdts_shell_ioctl_stat:256] Recv ioctl req with op 2
Feb 7 23:04:59 kernel: usb 2-1: USB disconnect, address 2
Feb 7 23:04:59 rc_service: hotplug 29535:notify_rc restart_nasapps
Feb 7 23:04:59 iTunes: daemon is stopped
Feb 7 23:04:59 FTP_Server: daemon is stopped
Feb 7 23:05:00 rc_service: hotplug 29536:notify_rc restart_nasapps
Feb 7 23:05:00 rc_service: waitting "restart_nasapps" via ...
Feb 7 23:05:01 Samba_Server: smb daemon is stopped
Feb 7 23:05:01 kernel: gro disabled
Feb 7 23:05:01 Timemachine: daemon is stopped
Feb 7 23:05:01 miniupnpd[3023]: shutting down MiniUPnPd
Feb 7 23:05:01 kernel: gro enabled with interval 2
Feb 7 23:05:02 Samba_Server: daemon is started
Feb 7 23:05:02 miniupnpd[29561]: HTTP listening on port 36074
Feb 7 23:05:02 miniupnpd[29561]: Listening for NAT-PMP/PCP traffic on port 5351
Feb 7 23:05:03 iTunes: daemon is stopped
Feb 7 23:05:03 FTP_Server: daemon is stopped
Feb 7 23:05:03 miniupnpd[29561]: upnp_event_recv: recv(): Connection reset by peer
Feb 7 23:05:04 kernel: usb 2-1: new high speed USB device using ehci_hcd and address 3
Feb 7 23:05:05 kernel: scsi1 : usb-storage 2-1:1.0
Feb 7 23:05:05 Samba_Server: smb daemon is stopped
Feb 7 23:05:05 kernel: gro disabled
Feb 7 23:05:05 Timemachine: daemon is stopped
Feb 7 23:05:05 miniupnpd[29561]: shutting down MiniUPnPd
Feb 7 23:05:05 kernel: gro enabled with interval 2
Feb 7 23:05:06 kernel: scsi 1:0:0:0: Direct-Access SanDisk Ultra 1.00 PQ: 0 ANSI: 6
Feb 7 23:05:06 kernel: sd 1:0:0:0: Attached scsi generic sg0 type 0
Feb 7 23:05:06 kernel: sd 1:0:0:0: [sda] 30464000 512-byte logical blocks: (15.5 GB/14.5 GiB)
Feb 7 23:05:06 kernel: sd 1:0:0:0: [sda] Write Protect is off
Feb 7 23:05:06 kernel: sd 1:0:0:0: [sda] Mode Sense: 43 00 00 00
Feb 7 23:05:06 kernel: sd 1:0:0:0: [sda] Assuming drive cache: write through
Feb 7 23:05:06 kernel: sd 1:0:0:0: [sda] Assuming drive cache: write through
Feb 7 23:05:06 kernel: sda: sda1
Feb 7 23:05:06 kernel: sd 1:0:0:0: [sda] Assuming drive cache: write through
Feb 7 23:05:06 kernel: sd 1:0:0:0: [sda] Attached SCSI removable disk
Feb 7 23:05:07 Samba_Server: daemon is started
Feb 7 23:05:07 miniupnpd[29612]: HTTP listening on port 52075
Feb 7 23:05:07 miniupnpd[29612]: Listening for NAT-PMP/PCP traffic on port 5351
Feb 7 23:05:08 hotplug[29613]: USB ext3 fs at /dev/sda1 mounted on /tmp/mnt/16GB(1)
Feb 7 23:05:08 usb: USB ext3 fs at /dev/sda1 mounted on /tmp/mnt/16GB(1).
Feb 7 23:05:08 kernel: EXT3-fs: barriers not enabled
Feb 7 23:05:08 kernel: kjournald starting. Commit interval 5 seconds
Feb 7 23:05:08 kernel: EXT3-fs (sda1): using internal journal
Feb 7 23:05:08 kernel: EXT3-fs (sda1): mounted filesystem with ordered data mode
Feb 7 23:05:08 rc_service: hotplug 29613:notify_rc restart_nasapps
Feb 7 23:05:08 iTunes: daemon is stopped
Feb 7 23:05:08 FTP_Server: daemon is stopped
Feb 7 23:05:08 miniupnpd[29612]: upnp_event_recv: recv(): Connection reset by peer
Feb 7 23:05:09 Samba_Server: smb daemon is stopped
Feb 7 23:05:09 kernel: gro disabled
Feb 7 23:05:10 Timemachine: daemon is stopped
Feb 7 23:05:10 miniupnpd[29612]: shutting down MiniUPnPd
Feb 7 23:05:10 kernel: gro enabled with interval 2
Feb 7 23:05:10 Samba_Server: daemon is started
Feb 7 23:05:10 miniupnpd[29648]: HTTP listening on port 60470
Feb 7 23:05:10 miniupnpd[29648]: Listening for NAT-PMP/PCP traffic on port 5351
Feb 7 23:05:13 miniupnpd[29648]: upnp_event_recv: recv(): Connection reset by peer
 
It does seem to mount indeed, at least initially, but I can't figure out why it didn't show up in df -h...

If there's nothing else on the drive, try running (from a terminal) the following code (before the #):

Code:
umount /tmp/mnt/16GB #assuming it is still somehow mounted
e2fsck -fpv /dev/sda1 #this will run a forced filecheck on the partition, automatically repair if possible without user input and output verbose

and please post the output.
It shows now?
GoNz0@Router:/tmp/home/root# df -h
Filesystem Size Used Available Use% Mounted on
/dev/root 33.6M 33.6M 0 100% /
devtmpfs 124.8M 0 124.8M 0% /dev
tmpfs 124.9M 1.7M 123.2M 1% /tmp
/dev/mtdblock4 62.8M 6.1M 56.6M 10% /jffs
/dev/root 33.6M 33.6M 0 100% /usr/sbin/tc
/dev/sda1 14.3G 4.1M 13.6G 0% /tmp/mnt/16GB(1)
GoNz0@Router:/tmp/home/root#


But

Info: This operation will install a swap file for your device
Info: You need an external USB storage to host this file
=> Do you want to install a swap file (512MB on ext filesystem partition)? [y/n]: y
Info: Available partition to install swap file:
1) /mnt/16GB(1)
installer: eval: line 1: syntax error: unexpected "("
GoNz0@Router:/tmp/home/root#

Never got that far before, it just said it wasn't there before.

I just logged into WinSCP and went into /mnt, it now shows the original 16GB and a new 16GB(1)

Rebooting takes it back to the original 16GB and no drive found.
 
Last edited:
It shows now?
If it shows now, you should be able to create a swapfile on it. You can do it manually by entering the following in a terminal

Code:
dd if=/dev/zero of=/tmp/mnt/16GB/myswap.swp bs=1k count=262144
mkswap /tmp/mnt/16GB/myswap.swp
swapon /tmp/mnt/16GB/myswap.swp

That's for a 256Mb swap. If you want a 512Mb swap, replace 262144 with 524288.

To make sure it's activated at reboot, append the following line to /jffs/scripts/post-mount

Code:
swapon /tmp/mnt/16GB/myswap.swp

Check with

Code:
free

whether your swap is active.
 

Similar threads

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top