Questions tagged [script]

non-compiled programs written in scripting languages (e.g. perl, python or tcl) or command line interpreters such as Unix shell.

Filter by
Sorted by
Tagged with
225 votes
12 answers
932k views

Execute script on start-up

I am trying to execute a script when my Raspberry Pi boots up. I would like the web browser to open up automatically. I have tried to find a simple solution, (like dropping my script in some "...
Tyler Murry's user avatar
  • 2,353
11 votes
2 answers
9k views

Log output of background or boot script

I have a short script which is executed by a system daemon for particular events. I know the event is occurring and the script is executing, but it does not do what I intend. Strangely, it does when ...
goldilocks's user avatar
  • 58.7k
4 votes
2 answers
3k views

How to set up dashboard for monitoring PI processes

I have PIs that use a schedule to play videos on loop. The PIs also use a daemon file 'surround.sh' to control the video player, and the daemon script allows the user to check the service status of ...
Kai's user avatar
  • 41
12 votes
2 answers
13k views

Is there a way to automatically activate a script when a USB device connects?

I have a USB device (POV camera) that collects a lot of data a fills up its storage regularly. The goal is to write a script that: Listens for the device to connect via USB Mounts it as a storage ...
user3.1415927's user avatar
3 votes
2 answers
14k views

Run a script at shutdown on Raspbian

I'm trying to run a script right before my Pi shuts down. OS: Raspbian Stretch Here is what I did so fare: put my script (name: sendir) in /etc/init.d/ created a symbolic link to it in /etc/rc6.d ...
apfelcast's user avatar
7 votes
3 answers
7k views

Clone Raspberry Pi SDCard to file on Mac OS X?

Is there a simple way using Mac OS X (shell preferred) to clone an entire SDCard from the SDCard slot (byte-for-byte)), to a file? I would then want to reverse the process and restore the image from ...
Will's user avatar
  • 373
5 votes
2 answers
26k views

How to run a script (Node.js) at startup [duplicate]

I've bee reading about running scripts at startup since last weak with no results. I just need to run an application located on my home (/home/pi) at startup (unattended). I tried creating a script at ...
vazquezjm's user avatar
4 votes
3 answers
2k views

How to make Raspberry shutdown when I unplug the ethernet cable

I use my Raspberry Pi Model B with Raspbian as a server and I want to know (if it is possible) how to make that the Raspberry pi send itself a halt command when I unplug the Ethernet cable (eth0) Any ...
Flipacholas's user avatar
5 votes
2 answers
15k views

Autorun Firefox on startup...grrrrrrr!

Long Story (Short): Okay, I've read all of the guides, questions etc I can find and it's still not happening. I can't get the browser to open its self up when the pi boots. Background: I'm following ...
Mr G Dwyer's user avatar
2 votes
2 answers
11k views

Run a shell script from a python script when a button is pressed

I'm trying to create a very simple python script that waits for a GPIO button press and then runs a shell script. I personally don't know much about python so what I've come up with is mostly from ...
Sam Cairns's user avatar
2 votes
2 answers
277 views

how to update customised OS image to a newer version keeping modification?

I am using Hypriot as OS . I have done modifications to some file and script,and i have add new service on boot . I would like to know if i have a newer version of Hypriot how can i update my ...
zamankar's user avatar
2 votes
3 answers
7k views

How do I delay transmission-daemon startup until all shares are mounted?

I've installed transmission-deamon on Raspbian. I've set it up to directly download on to a NAS share, which is mounted at /home/pi/nas/public via CIFS in /etc/fstab. All this generally works fine, ...
aalaap's user avatar
  • 234
2 votes
0 answers
8k views

ufw Error: Couldn't determine iptables version [closed]

I am currently working on an automated shell setup script for my Raspberry Pi 4. This includes installing and setting up ufw as my firewall. However, I'm currently stuck with configuring ufw. My ...
Pievee's user avatar
  • 21
1 vote
2 answers
2k views

Switch Raspberry (RaspAP) from an AP to a Wifi Client in a script

Switch Raspberry Hotspot "RaspAP" (wlan0) to a simple Wifi Device via a script What is missing #!/bin/bash # This script will stop the RASPAP Hotspot (AP+DHP) and will Switch your ...
Christian Klugesherz's user avatar
1 vote
3 answers
3k views

Can't stop script from running at start up

Hope this is the correct forum. I'm new to Raspberry Pi and programming. I have been trying to get my script running at startup without any success, until I found an answer on stack overflow. ...
ThomasD's user avatar
  • 39
1 vote
0 answers
54 views

Raspberry Pi OS is not starting after executing bad Shell Script [duplicate]

Today I was trying to setup Owncloud in my Raspberry Pi, then I stuck when there is need to giving ownership or adding Owncloud file to www-data user and group. After trying all possible options I ...
Abhishek Verma's user avatar
1 vote
1 answer
294 views

How to write a initial script and let it run a command automatically

As the title saying, I want to start on this. sudo service (my service name) start. Where do I write this script that can make service initially start? My service is "apache2" and "bluetooth". ...
jefferyear's user avatar
1 vote
1 answer
5k views

boot time start up code on Raspberry pi 3 jessie by adding script under init.d

to run a script at start-up on my Raspberry pi 3 board ( with jessie lite ) : 1- I added one init script under /etc/init.d/ directory. I can start,stop,restart service using script manually. ### ...
hossein valizadeh's user avatar
1 vote
3 answers
797 views

rc.local is recreated each boot?

This has to be the strangest thing I have seen on Linux yet. It's almost like I'm running a live CD but clearly not. I did a standard raspberry install and have been using it for a long time. I wanted ...
user2144480's user avatar
1 vote
3 answers
829 views

Script to retry wifi 10 times then force reboot if connection cannot be established

My Headless PI has been running for months without any problems, but in the last few days I've run into problems SSH'ing to it, and thus have had to pull the power. I had disabled powersavig mode in ...
reggie's user avatar
  • 1,121
1 vote
2 answers
3k views

Can I launch a script remotely with ssh and leave it running

I have tried appending '&' but the script is still stopped when my remote connection is terminated
David Sykes's user avatar
  • 1,435
1 vote
3 answers
1k views

script runs at terminal - but not in cron

I'm logged in as user pi via SSH and have a wifi checking script wifi_test_1.sh in the following directry: /usr/src/scripts/wifi_test_1.sh When i enter the command /usr/src/scripts/wifi_test_1.sh ...
reggie's user avatar
  • 1,121
1 vote
1 answer
2k views

Issues when trying to open Chromium at a certain URL on boot

I am having some issues with automating tasks at boot on the Pi. I have tried numerous different methods to do this including the systemd method and the .bashrc method. The command is a simple one ...
JayBuckel's user avatar
0 votes
4 answers
2k views

Control fan to lower temperatur via script [duplicate]

I have a raspberry pi 4 and a small fan in the case. I know that the pi can run without a fan but I already have one installed so why not using it. The problem is, that this small fan does make a ...
sirzento's user avatar
  • 221
0 votes
1 answer
3k views

why my script is not executed with root privileges using Crontab?

I have a working bash script and I want to run this script every minute with root privileges using crontab. I created my crontab as follows. >sudo crontab -e Then the file opened and I entered my ...
ThN's user avatar
  • 1,053
0 votes
1 answer
1k views

Run script to setup Socks Proxy on Pi Startup

I'm new to the Pi, and have come across heaps of streams that seem to need you to pair using the same IP before they will play - Openload etc... I read and found you can create a socks proxy that ...
dmr's user avatar
  • 3
-2 votes
1 answer
316 views

Running a program on boot (Pi 4)

I have been trying to get a program to start automatically on boot. I have tried using systemd, init.d, rc.local, and cron to execute my bash script in order to invoke a program (e.g. open an instance ...
Riaementi's user avatar