Go to advanced search

by johnnyo1012
Thu Jul 27, 2017 3:54 pm
Forum: General discussion
Topic: Password Protect SD Card?
Replies: 20
Views: 4108

Re: Password Protect SD Card?

rpiboy wrote: If you do CODE: SELECT ALL cat /proc/cpuinfo There is a serial number unique to every Raspberry Pi. You can write a script that gets and validates the serial number and if the number doesn't match, CODE: SELECT ALL sudo reboot or sudo rm / If an average person copies the sd card and p...
by johnnyo1012
Fri Jul 14, 2017 11:51 am
Forum: General discussion
Topic: Trying to run Script but get an error!
Replies: 11
Views: 1451

Re: Trying to run Script but get an error!

How do I fix this? After the error I get disconnected via ssh. Is this what it's supposed to do? The rm command will fail for the reason it gives. Looking at it I think it is supposed to try and delete every file on your Pi and if that fails it will reboot. (Rather drastic!) RaTTuS version is bette...
by johnnyo1012
Fri Jul 14, 2017 2:50 am
Forum: General discussion
Topic: Trying to run Script but get an error!
Replies: 11
Views: 1451

Re: Trying to run Script but get an error!

You probably need to quote $SERIAL: while [ "$SERIAL" != "Your serial number" ]; do sudo rm / || sudo reboot done Please note that this script may wreck your system beyond repair. It will NOT protect your SD card from being read by a card reader or whatever. Even if the script gets triggered by ano...
by johnnyo1012
Thu Jul 13, 2017 3:24 pm
Forum: General discussion
Topic: Trying to run Script but get an error!
Replies: 11
Views: 1451

Trying to run Script but get an error!

Hi, I am trying to run this script but get an error,

Code: Select all


while [ $SERIAL != "Your serial number" ]; do
      sudo rm / || sudo reboot
    done

I get the error- serial.sh: 2: [: !=: unexpected operator
by johnnyo1012
Thu Jul 13, 2017 1:37 am
Forum: General discussion
Topic: Password Protect SD Card?
Replies: 20
Views: 4108

Re: Password Protect SD Card?

If you do cat /proc/cpuinfo There is a serial number unique to every Raspberry Pi. You can write a script that gets and validates the serial number and if the number doesn't match, sudo reboot or sudo rm / If an average person copies the sd card and put it in their PI all contents will be erased or...
by johnnyo1012
Wed Jul 12, 2017 8:15 pm
Forum: General discussion
Topic: Password Protect SD Card?
Replies: 20
Views: 4108

Re: Password Protect SD Card?

Hi, is it possible to password protect the sd card? Every time this issue comes up, I feel that I must ask: What is it that you are trying so hard to protect? Is it code? Do you think your code is unique and that no one else will ever write a program to do the same thing? Is it data, such as names ...
by johnnyo1012
Wed Jul 12, 2017 7:07 pm
Forum: General discussion
Topic: Password Protect SD Card?
Replies: 20
Views: 4108

Re: Password Protect SD Card?

If a drive or memory card can be read by the Pi, then it can be read by anything else as well - this should be obvious. It is not possible for a drive or memory card to recognize the device which is accessing it and thereby decide wheter or not the contents should be made available to that device. ...
by johnnyo1012
Wed Jul 12, 2017 5:34 pm
Forum: General discussion
Topic: Password Protect SD Card?
Replies: 20
Views: 4108

Re: Password Protect SD Card?

Can't be done. Also would not protect against image copying. If you are worried about copying, add an appropriate USB key dongle. Thanks, I would like to password protect the sd card so someone can't plug the sd card into a computer and get the contents but if it is plugged in to a certain sd card ...
by johnnyo1012
Wed Jul 12, 2017 5:32 pm
Forum: General discussion
Topic: How to protect SD Card from files being copied to computer.
Replies: 3
Views: 570

How to protect SD Card from files being copied to computer.

Hey Guys, how can I make my Raspberry Pi SD Card protected so the files cannot be copied to a computer or to another SD Card to be used in another raspberry pi? I would like to use a serial number check. Please help. Thanks.
by johnnyo1012
Wed Jul 12, 2017 4:16 pm
Forum: General discussion
Topic: Password Protect SD Card?
Replies: 20
Views: 4108

Re: Password Protect SD Card?

Thanks, I would like to password protect the sd card so someone can't plug the sd card into a computer and get the contents but if it is plugged in to a certain sd card it works.
by johnnyo1012
Tue Jul 11, 2017 2:15 am
Forum: General discussion
Topic: Password Protect SD Card?
Replies: 20
Views: 4108

Password Protect SD Card?

Hi, is it possible to password protect the sd card?
by johnnyo1012
Mon Jul 10, 2017 6:32 pm
Forum: General discussion
Topic: How to create script to run commands?
Replies: 21
Views: 1828

Re: How to create script to run commands?

crontab -e (with a space between b and minus) That worked, now I get all of this- Do I add 6 to the last line? # daemon's notion of time and timezones. # # Output of the crontab jobs (including errors) is sent through # email to the user the crontab file belongs to (unless redirected). # # For exam...
by johnnyo1012
Mon Jul 10, 2017 6:27 pm
Forum: General discussion
Topic: How to create script to run commands?
Replies: 21
Views: 1828

Re: How to create script to run commands?

NotRequired wrote:No, you add it to crontab and you edit your crontab with the command "crontab -e" which loads the crontab into nano (console editor).
I type crontab-e via ssh and it says command not found?
by johnnyo1012
Mon Jul 10, 2017 6:16 pm
Forum: General discussion
Topic: How to create script to run commands?
Replies: 21
Views: 1828

Re: How to create script to run commands?

johnnyo1012 wrote:
NotRequired wrote:Yes, create a cron job for it with command "crontab -e", go to last line and add: "* 6 * * * /path/to/script.sh". Press CTRL+O and then RETURN. CTRL+X exits editor. The "6" is the hour to run the job at.
Do I need to set my Pi's time?? If so, how do I do that?
Do I add this to the script code?
by johnnyo1012
Mon Jul 10, 2017 6:12 pm
Forum: General discussion
Topic: How to create script to run commands?
Replies: 21
Views: 1828

Re: How to create script to run commands?

If your Pi is hooked up to the internet, it should set its own time using NTP. If not, you can set it manually: https://www.cyberciti.biz/faq/howto-set-date-time-from-linux-command-prompt/ Yes, it is connected to the internet is it possible to override the time that is automatically set for testing...
by johnnyo1012
Mon Jul 10, 2017 6:08 pm
Forum: General discussion
Topic: How to create script to run commands?
Replies: 21
Views: 1828

Re: How to create script to run commands?

NotRequired wrote:Yes, create a cron job for it with command "crontab -e", go to last line and add: "* 6 * * * /path/to/script.sh". Press CTRL+O and then RETURN. CTRL+X exits editor. The "6" is the hour to run the job at.
Do I need to set my Pi's time?? If so, how do I do that?
by johnnyo1012
Mon Jul 10, 2017 5:58 pm
Forum: General discussion
Topic: How to create script to run commands?
Replies: 21
Views: 1828

Re: How to create script to run commands?

Is it possible to schedule this script to run every day at a certain time? I would like it to run every day at 6:00am EST. Is this possible?
by johnnyo1012
Mon Jul 10, 2017 5:57 pm
Forum: General discussion
Topic: How to create script to run commands?
Replies: 21
Views: 1828

Re: How to create script to run commands?

I got it to work using this -

Code: Select all

 

#!/bin/bash
if [ "$(echo pow 0 | cec-client -s -d 1)" == "power status: on" ]; then exit 0;$
echo on 0 | cec-client -s -d 1

by johnnyo1012
Mon Jul 10, 2017 5:52 pm
Forum: General discussion
Topic: How to create script to run commands?
Replies: 21
Views: 1828

Re: How to create script to run commands?

These are the commands I made alias for-

Turn tv on: echo on 0 | cec-client -s -d 1
Turn tv off: echo standby 0 | cec-client -s -d 1
Tv status: echo pow 0 | cec-client -s -d 1
by johnnyo1012
Mon Jul 10, 2017 5:51 pm
Forum: General discussion
Topic: How to create script to run commands?
Replies: 21
Views: 1828

Re: How to create script to run commands?

DougieLawson wrote:

Code: Select all

if [ "$(tvstatus)" == "on" ]; then
 exit 0
fi
tvon

The "tvon" and "tvstatus" commands are alias's? Does that affect my issue? I got another error-

test7.sh: 2: test7.sh: tvstatus: not found
test7.sh: 2: [: unexpected operator
test7.sh: 3: test7.sh: tvon: not found
by johnnyo1012
Mon Jul 10, 2017 5:36 pm
Forum: General discussion
Topic: How to create script to run commands?
Replies: 21
Views: 1828

Re: How to create script to run commands?

I keep getting the error-

Syntax error: "fi" unexpected (expecting "then")


How do I fix it?
by johnnyo1012
Mon Jul 10, 2017 5:22 pm
Forum: General discussion
Topic: How to create script to run commands?
Replies: 21
Views: 1828

Re: How to create script to run commands?

When I run the command to check the status it gives me one of these below. Will your code work?

power status: on
power status: standby
by johnnyo1012
Mon Jul 10, 2017 4:08 pm
Forum: General discussion
Topic: How to create script to run commands?
Replies: 21
Views: 1828

How to create script to run commands?

Hi guys, I need help creating a script. I need a script to run commands. I need a script to run the command 'tvstatus" if the result of that command is "on" I need nothing else to happen. If the result of that command I need the script to run the command "tvon". How can I create a script to do this?...

Go to advanced search