11 |
#%before: |
#%before: |
12 |
#%after: |
#%after: |
13 |
|
|
14 |
# $Header: /home/cvsd/alx-cvs/alx-src/alxconfig-ng/init.d/alxsettings,v 1.24 2005-10-09 23:20:17 niro Exp $ |
# $Header: /home/cvsd/alx-cvs/alx-src/alxconfig-ng/init.d/alxsettings,v 1.27 2005-10-11 12:10:15 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 |
37 |
source /usr/lib/alxconfig-ng/functions/config_x11 |
source /usr/lib/alxconfig-ng/functions/config_x11 |
38 |
source /usr/lib/alxconfig-ng/functions/config_auth |
source /usr/lib/alxconfig-ng/functions/config_auth |
39 |
source /usr/lib/alxconfig-ng/functions/config_ssh_auth |
source /usr/lib/alxconfig-ng/functions/config_ssh_auth |
40 |
|
source /usr/lib/alxconfig-ng/functions/config_versions |
41 |
|
|
42 |
# check if mysql is available |
# check if mysql is available |
43 |
[ -x /usr/bin/mysql ] && MYSQL_ALX=true |
[ -x /usr/bin/mysql ] && MYSQL_ALX=true |
94 |
|
|
95 |
# exchange ssh rsa keys |
# exchange ssh rsa keys |
96 |
HOME=/root config_ssh_auth |
HOME=/root config_ssh_auth |
97 |
|
|
98 |
|
# import version info |
99 |
|
config_version |
100 |
} |
} |
101 |
|
|
102 |
get_system_serial() |
get_system_serial() |
381 |
module, |
module, |
382 |
resolution, |
resolution, |
383 |
depth, |
depth, |
384 |
monitorid |
refresh_rate |
385 |
) |
) |
386 |
values( |
values( |
387 |
'${ALX_SERIAL}', |
'${ALX_SERIAL}', |
388 |
'${XMODULE}', |
'${XMODULE}', |
389 |
'1024x768', |
'1024x768', |
390 |
'16', |
'16', |
391 |
'0' |
'60' |
392 |
);"; ) |
);"; ) |
393 |
evaluate_retval |
evaluate_retval |
394 |
|
|
431 |
echo -e " Screensaver settings ..." |
echo -e " Screensaver settings ..." |
432 |
mysqldo "insert into cfg_screensaver(serial,screensaver) values('${ALX_SERIAL}','')" |
mysqldo "insert into cfg_screensaver(serial,screensaver) values('${ALX_SERIAL}','')" |
433 |
|
|
434 |
|
# version info |
435 |
|
local alx_os |
436 |
|
local alx_utils |
437 |
|
alx_os="$(< /etc/mageversion)" |
438 |
|
alx_utils="$(magequery -n alxconfig-ng-alx | sed 's:.*\[\ \(.*\)\ \].*:\1:')" |
439 |
|
alx_utils="${alx_utils/alxconfig-ng-alx-}" |
440 |
|
mysqldo "insert into client_version(serial,os,utils) values('${ALX_SERIAL}','${alx_os}','${alx_utils}')" |
441 |
|
|
442 |
evaluate_retval |
evaluate_retval |
443 |
} |
} |
444 |
|
|
521 |
module='${XMODULE}', |
module='${XMODULE}', |
522 |
resolution='1024x768', |
resolution='1024x768', |
523 |
depth='16', |
depth='16', |
524 |
monitorid='0' |
refresh_rate='60' |
525 |
where serial=${ALX_SERIAL};" |
where serial=${ALX_SERIAL};" |
526 |
evaluate_retval |
evaluate_retval |
527 |
|
|
529 |
echo -e " Input settings ..." |
echo -e " Input settings ..." |
530 |
mysqldo "update cfg_input set mouse='${XMOUSETYPE}' where serial=${ALX_SERIAL};" |
mysqldo "update cfg_input set mouse='${XMOUSETYPE}' where serial=${ALX_SERIAL};" |
531 |
evaluate_retval |
evaluate_retval |
532 |
|
|
533 |
|
# version info |
534 |
|
local alx_os |
535 |
|
local alx_utils |
536 |
|
alx_os="$(< /etc/mageversion)" |
537 |
|
alx_utils="$(magequery -n alxconfig-ng-alx | sed 's:.*\[\ \(.*\)\ \].*:\1:')" |
538 |
|
alx_utils="${alx_utils/alxconfig-ng-alx-}" |
539 |
|
mysqldo "update client_version set os='${alx_os}', utils='${alx_utils}' where serial=${ALX_SERIAL};" |
540 |
} |
} |
541 |
|
|
542 |
# imports current settings to the local system resolved by the hardware detection |
# imports current settings to the local system resolved by the hardware detection |
649 |
--icon-width "1" \ |
--icon-width "1" \ |
650 |
--icon-height "1" |
--icon-height "1" |
651 |
|
|
652 |
|
# create a xinitrc |
653 |
|
echo "exec startfluxbox" > ${ALX_UNPRIV_HOME}/.xinitrc |
654 |
|
|
655 |
# set correct permissions |
# set correct permissions |
656 |
chown ${ALX_UNPRIV_USER}:${ALX_UNPRIV_GROUP} ${ALX_UNPRIV_HOME} |
chown ${ALX_UNPRIV_USER}:${ALX_UNPRIV_GROUP} ${ALX_UNPRIV_HOME} |
657 |
chown ${ALX_UNPRIV_USER}:${ALX_UNPRIV_GROUP} ${ALX_UNPRIV_HOME}/.fluxbox |
chown ${ALX_UNPRIV_USER}:${ALX_UNPRIV_GROUP} ${ALX_UNPRIV_HOME}/.fluxbox |
658 |
chmod 0755 ${ALX_UNPRIV_HOME}/.fluxbox |
chmod 0755 ${ALX_UNPRIV_HOME}/.fluxbox |
659 |
chmod 0755 ${ALX_UNPRIV_HOME}/.xtdesktop |
chmod 0755 ${ALX_UNPRIV_HOME}/.xtdesktop |
660 |
chmod 0644 ${ALX_UNPRIV_HOME}/.xtdeskrc |
chmod 0644 ${ALX_UNPRIV_HOME}/.xtdeskrc |
661 |
|
chmod 0644 ${ALX_UNPRIV_HOME}/.xinitrc |
662 |
} |
} |
663 |
|
|
664 |
# start|stop |
# start|stop |
727 |
if ps -A|grep dhcpcd > /dev/null |
if ps -A|grep dhcpcd > /dev/null |
728 |
then |
then |
729 |
dhcpcd -z &> /dev/null |
dhcpcd -z &> /dev/null |
730 |
|
sleep 1 |
731 |
fi |
fi |
732 |
evaluate_retval |
evaluate_retval |
733 |
;; |
;; |
765 |
rm -f /etc/alxconfig-ng/serial |
rm -f /etc/alxconfig-ng/serial |
766 |
rm -rf /etc/alxconfig-ng/state |
rm -rf /etc/alxconfig-ng/state |
767 |
|
|
768 |
|
# clear all printers & net-shares |
769 |
|
:> /etc/cups/printers.conf |
770 |
|
:> /etc/samba/smb.conf |
771 |
|
|
772 |
|
# remove inetd, cups & smb from init |
773 |
|
rc-config del inetd &> /dev/null |
774 |
|
rc-config del cups &> /dev/null |
775 |
|
rc-config del samba &> /dev/null |
776 |
|
|
777 |
|
# remove all user settings |
778 |
|
[ -d ${ALX_UNPRIV_HOME} ] && rm -rf ${ALX_UNPRIV_HOME} |
779 |
|
|
780 |
|
# remove all ica-sessions |
781 |
|
find ${ALX_ICA_SESSIONS} -type f -name '*.ica' | xargs rm |
782 |
|
|
783 |
|
# remove all old nics and modules configs |
784 |
|
find /etc/conf.d -type f -name 'net.*' | xargs rm |
785 |
|
find /etc/modules.d -type f -name 'net.*' | xargs rm |
786 |
|
|
787 |
|
# restore default networking |
788 |
|
cat ${ALX_SKELETONS}/net/net.eth0 > /etc/conf.d/net.eth0 |
789 |
|
|
790 |
echo "I am done now, press [Enter] to reboot system ..." |
echo "I am done now, press [Enter] to reboot system ..." |
791 |
else |
else |
792 |
echo "Aborted, press [Enter] to reboot system ..." |
echo "Aborted, press [Enter] to reboot system ..." |