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

NAME
cron - The system clock daemon SYNOPSIS
/usr/sbin/cron DESCRIPTION
The cron daemon runs shell commands at specified dates and times. Commands that are to run according to a regular or periodic schedule are found within the crontab files. Commands that are to run once only are found within the at files. You submit crontab and at file entries by using the crontab and at commands. Because the cron process exits only when killed or when the system stops, only one cron daemon should exist on the system at any given time. Normally, you start the cron daemon from within a run command file. During process initialization and when cron detects a change, it examines the crontab and at files. This strategy reduces the overhead of checking for new or changed files at regularly scheduled intervals. The cron command creates a log of its activities. The cron daemon must be started from the system startup scripts because it must begin execution without a login user ID set. The cron daemon starts each job with the following process attributes stored with the job by the invoking process: Login user ID Effective and real user IDs Effective and real group IDs Supplementary groups It also establishes the following attributes from the authentication profile of the account associated with the login user ID of the invok- ing process: Audit control and disposition masks Kernel authorizations DIAGNOSTICS
The at and batch programs will refuse to accept jobs submitted from processes whose login user ID is different from the real user ID. FILES
Specifies the command path. Main cron directory Directory containing the crontab files. List of allowed users. List of denied users His- tory information for cron Queue description file for at, batch, and cron RELATED INFORMATION
Commands: at(1), crontab(1), rc0(8), rc2(8), rc3(8) Files: queuedefs(4) delim off cron(8)
All times are GMT -4. The time now is 08:27 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy