Go to advanced search

by Bosse_B
Fri Jun 07, 2019 10:40 pm
Forum: General discussion
Topic: script problem (again) - scratching my head...
Replies: 9
Views: 316

Re: script problem (again) - scratching my head...

hortimech wrote:
Fri Jun 07, 2019 6:58 am
Yes , I always run my scripts through shellcheck
No such command on RPi2, RPi3 nor Ubuntu18...
So must be installed.
Is it worth it for a very casual scripter?
by Bosse_B
Thu Jun 06, 2019 7:54 pm
Forum: General discussion
Topic: script problem (again) - scratching my head...
Replies: 9
Views: 316

Re: script problem (again) - scratching my head...

#!/bin/bash ^^^ no ! (bang) in yours. Didn't notice. Several of my scripts have this error but work anyway if [ -z "$2" ]; then kodiflag="$2" ^^^if nul then set nul? Oh Gosh! it should have been: if [ -z "$2" ]; then kodiflag="0" else kodiflag="$2" fi Hope that helps. I think you spotted two of my ...
by Bosse_B
Wed Jun 05, 2019 9:35 pm
Forum: General discussion
Topic: script problem (again) - scratching my head...
Replies: 9
Views: 316

script problem (again) - scratching my head...

I am trying to write a file copy script to handle video uploads to my Kodi media centers. I want to tell my script to upload to my website (this works fine) and to none, one or both media centers using a second parameter. This is the relevant part of my script dealing with this: #/bin/bash # Read co...
by Bosse_B
Mon Jun 03, 2019 7:23 pm
Forum: General discussion
Topic: Samba shares on RPi mounted on Ubuntu - how to resume after fail
Replies: 2
Views: 67

Re: Samba shares on RPi mounted on Ubuntu - how to resume after fail

Thanks, the command

Code: Select all

sudo mount -a

looks like what I need!
by Bosse_B
Mon Jun 03, 2019 5:04 pm
Forum: General discussion
Topic: Samba shares on RPi mounted on Ubuntu - how to resume after fail
Replies: 2
Views: 67

Samba shares on RPi mounted on Ubuntu - how to resume after fail

I have a couple of RPi units (RPi2B and RPi3B+) which have USB connected hard drives attached. These are automatically mounted on startup via /etc/fstab On both I have setup a samba share on the root of the USB drive with rw permissions. On an Ubuntu 18 server I mount these shares so I can copy over...
by Bosse_B
Sun Jun 02, 2019 11:46 am
Forum: General discussion
Topic: RPi3B+ very slow WiFi
Replies: 2
Views: 113

Re: RPi3B+ very slow WiFi

I am running OSMC on this new box so setting up WiFi etc is a bit different... Anyway I pulled the wired Ethernet and then I used the MyOSMC applet to change WiFi to use the 5G network. Now the results are as follows: Download: 100,106 Mbit/s Upload: 83,511 Mbit/s As can be seen a LOT better. So I s...
by Bosse_B
Sun Jun 02, 2019 7:53 am
Forum: General discussion
Topic: RPi3B+ very slow WiFi
Replies: 2
Views: 113

RPi3B+ very slow WiFi

I have just bought a new RPi (my 10th or so...) and this time it is an RPi3B+ When connected by Ethernet cable I get very good network speeds as tested with the Swedish "Bredbandskollen": Download: 224,220 Mbit/s Upload: 128,090 Mbit/s But when I switch to WiFi (pulling the Ethernet cable out) I get...
by Bosse_B
Sat Jun 01, 2019 7:52 pm
Forum: General discussion
Topic: fstab dilemma...
Replies: 2
Views: 238

Re: fstab dilemma...

It seems like the ownership of the /mnt/mediadrive directory does not matter.
If the setting in fstab is rw and "readonly = no" in the smb.conf then read/write works.

In any case I am done now and it all works.
by Bosse_B
Wed May 29, 2019 12:40 pm
Forum: General discussion
Topic: fstab dilemma...
Replies: 2
Views: 238

fstab dilemma...

I am using an RPi2B as media center through OSMC/KODI. This RPi has a 1TB USB disk connected as media storage and it was mounted whenever the RPi boots. The drive was also shared on the network via a samba share. After I did an OSMC update yesterday and got KODI 18 instead of 16 or 17 I had before t...
by Bosse_B
Sun Mar 10, 2019 10:45 am
Forum: General discussion
Topic: Need to script ftp transfers from RPi to public webserver
Replies: 14
Views: 395

Re: Need to script ftp transfers from RPi to public webserver

Note that I am using a commercial provider for my websites and I have no way to enable or configure the server side functionality. I simply have to use whatever they say I should use and for file uploads to the website they guide towards using FTP. I tried using FileZilla to connect explicitly to sf...
by Bosse_B
Sun Mar 10, 2019 7:50 am
Forum: General discussion
Topic: Need to script ftp transfers from RPi to public webserver
Replies: 14
Views: 395

Re: Need to script ftp transfers from RPi to public webserver

OK, I now see the sftp:// error where I did only have sftp:/ But it did not work anyway when I tested it.... So I switched to curl instead and wrote a script that uses curl and plain ftp to do the job. Then I locked down the script so it can't be read by anyone else than me because inside the script...
by Bosse_B
Sat Mar 09, 2019 8:43 pm
Forum: General discussion
Topic: Need to script ftp transfers from RPi to public webserver
Replies: 14
Views: 395

Re: Need to script ftp transfers from RPi to public webserver

Thanks, I saw this only after posting my reply above... I will try this suggestion. :) I tried the suggestion after installing lftp and creating the .netrc file but fell flat: ~$ lftp -e "pwd; bye" sftp:/xxxxxxx.[email protected].xxx.xx lftp: sftp: Name or service not known [email protected]:~$ which s...
by Bosse_B
Sat Mar 09, 2019 8:17 pm
Forum: General discussion
Topic: Need to script ftp transfers from RPi to public webserver
Replies: 14
Views: 395

Re: Need to script ftp transfers from RPi to public webserver

If you can't use authorized_keys and you're happy to have your sftp username (but not password) in the history buffer you could use lftp and .netrc create a .netrc ( note the dot) in the user's home directory file with the following contents:- machine ftp.foo.bar login username password password mo...
by Bosse_B
Sat Mar 09, 2019 8:15 pm
Forum: General discussion
Topic: Need to script ftp transfers from RPi to public webserver
Replies: 14
Views: 395

Re: Need to script ftp transfers from RPi to public webserver

There is an extension to TCL called Expect which would allow password-based logins over SFTP, but again, really, keys are the way to go. Expect does not exist on my Linux machines... which expect returns nothing at all. It's 2019. FTP needs to go away and never be mentioned again. The company that ...
by Bosse_B
Sat Mar 09, 2019 6:03 pm
Forum: General discussion
Topic: Need to script ftp transfers from RPi to public webserver
Replies: 14
Views: 395

Need to script ftp transfers from RPi to public webserver

I need to script regular transfers of rather big binary files from the RPi to my webhosting server. I was thinking of using sftp, but I have stumbled on the password entry because I don't want it to be part of the command line (will appear in history). But it must be possible to run from cron or sim...
by Bosse_B
Thu Mar 07, 2019 12:28 pm
Forum: Raspbian
Topic: ddclient configuration for quick response?
Replies: 2
Views: 109

Re: ddclient configuration for quick response?

Not really, the RPi is headless and only has a command line interface.
I use it via PuTTY and for that I need to know the IP address of the router.

So I am really mostly interested in the ddclient operations.
by Bosse_B
Thu Mar 07, 2019 11:34 am
Forum: Raspbian
Topic: ddclient configuration for quick response?
Replies: 2
Views: 109

ddclient configuration for quick response?

I have an RPi3 sitting as a temperature and humidity logger in my summer home. It is connected to the Internet via a mobile broadband router. The site is 100 km away and in wintertime I don't often go there. I have installed ddclient on the RPi in order to set the ip address of the dynamic host I us...
by Bosse_B
Mon Feb 18, 2019 7:32 pm
Forum: Raspbian
Topic: Bash script command to check swap and show error?
Replies: 8
Views: 533

Re: Bash script command to check swap and show error?

Yes sed is not what I am fluent in.. And in this case you would also have to know the file that holds swap info as well as the way to find the data item... free as a general command seems a bit more in line with what I am comfortable with as well as the grep, head and tail commands. New to me this t...
by Bosse_B
Sun Feb 17, 2019 10:50 pm
Forum: Raspbian
Topic: Bash script command to check swap and show error?
Replies: 8
Views: 533

Re: Bash script command to check swap and show error?

Through googling I found that grep is capable of extracting data too. So this is the original command to get the Swap data: $ free | grep Swap Swap: 102396 9984 92412 If I feed the response string into another grep I get this: $ free | grep Swap | grep -P -o "[0-9]+" | head -1 102396 So this is what...
by Bosse_B
Sun Feb 17, 2019 8:13 pm
Forum: Raspbian
Topic: Bash script command to check swap and show error?
Replies: 8
Views: 533

Re: Bash script command to check swap and show error?

You could use AWK: free | awk '$1~/Mem/&&$2>1000000{print $2; exit 1}'; echo $?; That'll work within an if-then-else shell statement. I made some tests with this by putting it into a test.sh file. After changing Mem to Swap and 1000000 to 100000 the result I got was two lines: 102396 (this is the s...
by Bosse_B
Sun Feb 17, 2019 5:31 pm
Forum: Raspbian
Topic: Bash script command to check swap and show error?
Replies: 8
Views: 533

Bash script command to check swap and show error?

I have a script I use on new RPi units to install some software tools from source. It works really well provided that the swap is set to 1GB but I tend to forget this and if it is the standard 100M then the scripted build winds into a problem some 30 minutes later. The error message does not say it ...
by Bosse_B
Tue Jan 29, 2019 5:03 pm
Forum: General discussion
Topic: WiFi temperature sensor for RPi3?
Replies: 24
Views: 14710

Re: WiFi temperature sensor for RPi3?

This is my thread from Sept 2017...... Seems like it is not really in use of revival. I have solved my logging task in a different way (DIY). So, I can supply the following updated information concerning Temp/Humidity logging: 1) Using RPi as controller A DHT sensor type AM2302 can be connected dire...
by Bosse_B
Tue Jan 15, 2019 9:04 am
Forum: General discussion
Topic: Checking Internet connectivity in startup script?
Replies: 9
Views: 566

Re: Checking Internet connectivity in startup script?

Several reasons for the report: 1) To know the IP address in order to connect All of my RPi units are headless, and they are not always sitting on a network where I can manage the router DHCP reservations. And sometimes I move them to new networks and so I always put this on my RPi units to help in ...
by Bosse_B
Mon Jan 14, 2019 10:24 am
Forum: General discussion
Topic: Checking Internet connectivity in startup script?
Replies: 9
Views: 566

Re: Checking Internet connectivity in startup script?

Yes, I think I have it nailed now. The application is for a remote installation where the RPi is monitoring the temp/humid in our summer home. It is located remotely and uses a mobile broadband router. There are occasional power outages and for these the RPi will start up almost instantly when power...
by Bosse_B
Sun Jan 13, 2019 1:48 pm
Forum: General discussion
Topic: Checking Internet connectivity in startup script?
Replies: 9
Views: 566

Re: Checking Internet connectivity in startup script?

PS. Love Sweden. Beautiful country. I have been there twice with my wife in the last three years and hope to go again soon :-) Well, Stockholm has sent in its application for the 2026 Winter Olympics on Friday... Only one competitor, Italy, but they hosted the games in 2006 so maybe February 2026 c...

Go to advanced search