I am newbie, I am missing something...
I have simple script saved in file /rc.d/initialize one one freebsd machine with permission
When I copy this file to another machine ( gui file explorer ) ( file permission on new machines are same when I run ls -l ) it does not work give me error message.
When I try to run.
ls -l on new machine
If I delete old file and recreate new file on new machine with with text editor and make it executable it works.
/rc.d/initialize
Any help really appreciate.
I have simple script saved in file /rc.d/initialize one one freebsd machine with permission
Code:
-r-xr-xr-x 1 root wheel 442 May 19 21:51 initialize
When I try to run.
Code:
/etc/rc.d/initialize start
Command not found message
Code:
-r-xr-xr-x 1 root wheel 442 May 19 21:51 initialize - On new machine
/rc.d/initialize
Code:
!/bin/sh
. /etc/rc.subr
name="initialize"
start_cmd="${name}_start"
stop_cmd=":"
initialize_start()
{
if [ -f /etc/initialize ]; then
echo "Default password set !"
sh -c "pwd_mkdb -p /etc/master.passwd"\
echo "Save all Files for /CFG"
sh -c "yes | sh /root/save_cfg"
sh -c "rm /etc/initialize"
fi
}
load_rc_config $name
run_rc_command "$1"