Sponsored Content
Operating Systems BSD MAC at @reboot, like some cellphone Post 302989542 by 1in10 on Saturday 14th of January 2017 05:04:22 AM
Old 01-14-2017
MAC at @reboot, like some cellphone

I want to change my MAC at reboot, so making it a cron job like the following in BSD.
Can I do this in the jail for the user, setting it as a command or should it be a script?

I would set it as a command

Code:
openssl rand -hex 6 | sed 's/\(..)/\1:/g; s/.$//'

just to test it, it works.


To make things easier, blinded by the light, I just took the macchanger script from my linux distro and set it already unpacked in the folder of
Code:
/home/name of the user/sbin/

setting the flags and doing it at or @reboot.

It works fine with just the command line!!!!


Code:
@reboot  usernamesomebody    openssl rand -hex 6 | sed 's/\(..)/\1:/g; s/.$//'

I am asking this, because the BSD handbook tells me to try it first as a homebrew script in the really
special environment, that is giving me a headache like the following

Code:
env -i SHELL=/bin/sh PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin HOME=

And my second question is, would it be better to set it in the system crontab
Code:
/etc/crontab

or just user crontab?

So if someone can help me out, thanks in advance!!!

Last edited by 1in10; 01-18-2017 at 05:53 AM.. Reason: SOLVED FINALLY
 

4 More Discussions You Might Find Interesting

1. Linux

Need direction to make code for cellphone in C,C++ or Perl

Hi All, I need a help from the techie guys in this group.Actually, i need to make a code which can make wallpaper and ringtone for a mobile phone using any method. I know C,C++ and perl langauges but doesnot having much knowledge of JAVA. So can anybody tell me that whether i can... (0 Replies)
Discussion started by: basileis
0 Replies

2. Solaris

different between soft reboot and hard reboot

Hi Guru's Can any want here could explain to me the different between soft reboot and hard reboot . Best Regards Seelan (3 Replies)
Discussion started by: seelan3
3 Replies

3. UNIX for Dummies Questions & Answers

Need Help to Reboot to Mac OS X

Hello. Somehow I got out of my gui Mac OS 10.2 into Unix single-user mode. No matter what I've tried, I can't get out of Unix. I've tried the command "reboot" with no success. I've tried a safe boot, an X boot, and a couple of others and nothing seems to work. I can use the Unix commands to... (4 Replies)
Discussion started by: philomaximus
4 Replies

4. Linux

convert avi to cellphone friendly 320x176 mp4 file...ffmpeg to the rescue :)

found a few ffmpeg posts and after a few unsuccessful attempts, I have found a solution :) to encode an avi to to an nokia e71 recognized mp4 format: ffmpeg -y -i inputFILE.avi -acodec aac -ab 72k -s 320x176 -aspect 16:9 -vcodec h264 -b 300k -qcomp 0.6 -qmin 16 -qmax 51 -qdiff 4 -flags +loop... (2 Replies)
Discussion started by: mr_manny
2 Replies
HALT(8) 							       halt								   HALT(8)

NAME
halt, poweroff, reboot - Halt, power-off or reboot the machine SYNOPSIS
halt [OPTIONS...] poweroff [OPTIONS...] reboot [OPTIONS...] DESCRIPTION
halt, poweroff, reboot may be used to halt, power-off or reboot the machine. OPTIONS
The following options are understood: --help Prints a short help text and exits. --halt Halt the machine, regardless of which one of the three commands is invoked. -p, --poweroff Power-off the machine, regardless of which one of the three commands is invoked. --reboot Reboot the machine, regardless of which one of the three commands is invoked. -f, --force Force immediate halt, power-off, reboot. Do not contact the init system. -w, --wtmp-only Only write wtmp shutdown entry, do not actually halt, power-off, reboot. -d, --no-wtmp Do not write wtmp shutdown entry. --no-wall Do not send wall message before halt, power-off, reboot. EXIT STATUS
On success, 0 is returned, a non-zero failure code otherwise. NOTES
These are legacy commands available for compatibility only. SEE ALSO
systemd(1), systemctl(1), shutdown(8), wall(1) systemd 208 HALT(8)
All times are GMT -4. The time now is 06:54 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy