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
reboot(8)						      System Manager's Manual							 reboot(8)

Name
       reboot - automatic reboot procedures

Syntax
       /etc/reboot [ -n ] [ -q ]

Description
       The  ULTRIX  system is booted by loading a kernel image, usually into memory at location zero and transferring to zero.	Because the system
       is not reenterable, the kernel image must be read in from disk each time the system is bootstrapped.

       When the reboot of a running system is desired, is normally used.  If there are no users, can be used.  The command causes the disks to	be
       synced,	and  then  a multiuser reboot is initiated.  The system is booted and an automatic disk check is performed.  If the procedure suc-
       ceeds, the system is then brought up for the users.

       The system will reboot itself after a power failure or after a crash, provided auto-restart is enabled on your system.  A consistency check
       of the file systems will be performed and, unless the check fails, the system will resume multiuser operations.

Options
       -n   Prevents the disks from being synced.

       -q   Reboots quickly and ungracefully, without shutting down running processes first.

Files
       System code

See Also
       crash(8v), fsck(8), halt(8), init(8), newfs(8), rc(8), shutdown(8)

																	 reboot(8)
All times are GMT -4. The time now is 11:10 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy