11 |
#%before: |
#%before: |
12 |
#%after: |
#%after: |
13 |
|
|
14 |
# $Header: /home/cvsd/alx-cvs/alx-src/alxconfig-ng/init.d/alxsettings,v 1.15 2005-08-17 21:19:52 niro Exp $ |
# $Header: /home/cvsd/alx-cvs/alx-src/alxconfig-ng/init.d/alxsettings,v 1.17 2005-08-18 08:10:46 niro Exp $ |
15 |
|
|
16 |
# checks first if the client was already configured and if it has an valid serial |
# checks first if the client was already configured and if it has an valid serial |
17 |
# if not it runs the autoconfiguration script |
# if not it runs the autoconfiguration script |
88 |
then |
then |
89 |
source /etc/alxconfig-ng/serial |
source /etc/alxconfig-ng/serial |
90 |
|
|
|
# doing this now before this function gets called |
|
91 |
# start preliminary networking (dhcp) |
# start preliminary networking (dhcp) |
92 |
# preliminary_network start |
preliminary_network start |
93 |
|
|
94 |
|
# check if mysql server is reachable |
95 |
|
# if not abort this script |
96 |
|
if ! reach_mysql_server |
97 |
|
then |
98 |
|
preliminary_network stop |
99 |
|
exit 1 |
100 |
|
fi |
101 |
|
|
102 |
CUR_IP=$(/sbin/ifconfig eth0 | sed -n '/addr:/s/ [^r]*..//gp') |
CUR_IP=$(/sbin/ifconfig eth0 | sed -n '/addr:/s/ [^r]*..//gp') |
103 |
CUR_MAC=$(/sbin/ifconfig eth0 | grep HWaddr | cut -d ' ' -f11) |
CUR_MAC=$(/sbin/ifconfig eth0 | grep HWaddr | cut -d ' ' -f11) |
122 |
echo |
echo |
123 |
if [ -f /hardware-auto-detection ] |
if [ -f /hardware-auto-detection ] |
124 |
then |
then |
125 |
echo -e ${COLMAGENTA}"Hardware-Auto-Detection forced by system-administrator"${COLDEFAULT} |
echo -e ${COLMAGENTA}"Hardware autodetection forced by system-administrator"${COLDEFAULT} |
126 |
else |
else |
127 |
echo -e ${COLMAGENTA}"Preparing system for first boot"${COLDEFAULT} |
echo -e ${COLMAGENTA}"Preparing system for first boot"${COLDEFAULT} |
128 |
fi |
fi |
141 |
# start preliminary networking (dhcp) |
# start preliminary networking (dhcp) |
142 |
preliminary_network start |
preliminary_network start |
143 |
|
|
144 |
|
# check if mysql server is reachable |
145 |
|
# if not abort this script |
146 |
|
if ! reach_mysql_server |
147 |
|
then |
148 |
|
preliminary_network stop |
149 |
|
exit 1 |
150 |
|
fi |
151 |
|
|
152 |
CUR_IP=$(/sbin/ifconfig eth0 | sed -n '/addr:/s/ [^r]*..//gp') |
CUR_IP=$(/sbin/ifconfig eth0 | sed -n '/addr:/s/ [^r]*..//gp') |
153 |
CUR_MAC=$(/sbin/ifconfig eth0 | grep HWaddr | cut -d ' ' -f11) |
CUR_MAC=$(/sbin/ifconfig eth0 | grep HWaddr | cut -d ' ' -f11) |
154 |
CUR_MTIME=$(date +%s) |
CUR_MTIME=$(date +%s) |
450 |
cat ${ALX_SKELETONS}/fluxbox/menu.header \ |
cat ${ALX_SKELETONS}/fluxbox/menu.header \ |
451 |
> ${ALX_UNPRIV_HOME}/.fluxbox/menu |
> ${ALX_UNPRIV_HOME}/.fluxbox/menu |
452 |
|
|
453 |
|
# now fix it with proper messages :P |
454 |
|
local ver="$(< /etc/mageversion)" |
455 |
|
sed -i "s:@CHANGEME@:alx-${ver} #${ALX_SERIAL}:g" \ |
456 |
|
${ALX_UNPRIV_HOME}/.fluxbox/menu |
457 |
|
|
458 |
# add a newline (maybe there is no crlf in the header) |
# add a newline (maybe there is no crlf in the header) |
459 |
echo >> ${ALX_UNPRIV_HOME}/.fluxbox/menu |
echo >> ${ALX_UNPRIV_HOME}/.fluxbox/menu |
460 |
|
|
469 |
chown ${ALX_UNPRIV_USER}:${ALX_UNPRIV_GROUP} ${ALX_UNPRIV_HOME} |
chown ${ALX_UNPRIV_USER}:${ALX_UNPRIV_GROUP} ${ALX_UNPRIV_HOME} |
470 |
chown ${ALX_UNPRIV_USER}:${ALX_UNPRIV_GROUP} ${ALX_UNPRIV_HOME}/.fluxbox |
chown ${ALX_UNPRIV_USER}:${ALX_UNPRIV_GROUP} ${ALX_UNPRIV_HOME}/.fluxbox |
471 |
chmod 0755 ${ALX_UNPRIV_HOME}/.fluxbox |
chmod 0755 ${ALX_UNPRIV_HOME}/.fluxbox |
|
chmod 0755 ${ALX_UNPRIV_HOME}/.idesktop |
|
|
chmod 0644 ${ALX_UNPRIV_HOME}/.ideskrc |
|
472 |
|
|
473 |
# default passwords are bad |
# default passwords are bad |
474 |
#usermod -p $(perl -e "printf(crypt('foobar','AD'))") root |
#usermod -p $(perl -e "printf(crypt('foobar','AD'))") root |
541 |
|
|
542 |
case $1 in |
case $1 in |
543 |
start) |
start) |
|
# start preliminary networking (dhcp) |
|
|
preliminary_network start |
|
|
|
|
|
# check if mysql server is reachable |
|
|
# if not abort this script |
|
|
if ! reach_mysql_server |
|
|
then |
|
|
preliminary_network stop |
|
|
exit 1 |
|
|
fi |
|
|
|
|
544 |
# retrieve or validate current serial |
# retrieve or validate current serial |
545 |
get_system_serial |
get_system_serial |
546 |
if [[ ${ALX_HW_DETECT} = true ]] |
if [[ ${ALX_HW_DETECT} = true ]] |