26 |
source /etc/alxconfig-ng/config.rc |
source /etc/alxconfig-ng/config.rc |
27 |
|
|
28 |
# helper functions |
# helper functions |
29 |
source /usr/lib/alxconfig-ng/functions/common |
source ${ALX_FUNCTIONS}/common |
30 |
source /usr/lib/alxconfig-ng/functions/mysqlfunctions |
source ${ALX_FUNCTIONS}/mysqlfunctions |
31 |
source /usr/lib/alxconfig-ng/functions/serial_functions |
source ${ALX_FUNCTIONS}/serial_functions |
32 |
source /usr/lib/alxconfig-ng/functions/config_modules |
source ${ALX_FUNCTIONS}/config_modules |
33 |
source /usr/lib/alxconfig-ng/functions/config_network |
source ${ALX_FUNCTIONS}/config_plugins |
34 |
source /usr/lib/alxconfig-ng/functions/config_printers |
source ${ALX_FUNCTIONS}/config_network |
35 |
source /usr/lib/alxconfig-ng/functions/config_sessions |
source ${ALX_FUNCTIONS}/config_printers |
36 |
source /usr/lib/alxconfig-ng/functions/config_x11 |
source ${ALX_FUNCTIONS}/config_sessions |
37 |
source /usr/lib/alxconfig-ng/functions/config_auth |
source ${ALX_FUNCTIONS}/config_x11 |
38 |
source /usr/lib/alxconfig-ng/functions/config_ssh_auth |
source ${ALX_FUNCTIONS}/config_auth |
39 |
source /usr/lib/alxconfig-ng/functions/config_versions |
source ${ALX_FUNCTIONS}/config_ssh_auth |
40 |
|
source ${ALX_FUNCTIONS}/config_versions |
41 |
|
|
42 |
# other needed vars |
# other needed vars |
43 |
ALX_HW_DETECT=false |
ALX_HW_DETECT=false |
60 |
# ! is the first thing that must be configured ! |
# ! is the first thing that must be configured ! |
61 |
config_modules |
config_modules |
62 |
|
|
63 |
|
# install or uninstall plugins |
64 |
|
config_plugins |
65 |
|
|
66 |
# imports network settings from db |
# imports network settings from db |
67 |
config_networking |
config_networking |
68 |
|
|
169 |
fi |
fi |
170 |
|
|
171 |
|
|
172 |
CUR_IP=$(/sbin/ifconfig eth0 | sed -n '/addr:/s/ [^r]*..//gp') |
CUR_IP=$(/sbin/ifconfig ${ALX_IFACE} | sed -n '/addr:/s/ [^r]*..//gp') |
173 |
CUR_MAC=$(/sbin/ifconfig eth0 | grep HWaddr | cut -d ' ' -f11) |
CUR_MAC=$(/sbin/ifconfig ${ALX_IFACE} | grep HWaddr | cut -d ' ' -f11) |
174 |
CUR_MTIME=$(date +%s) |
CUR_MTIME=$(date +%s) |
175 |
|
|
176 |
# abort now if this is a forced re-check |
# abort now if this is a forced re-check |
424 |
local alx_os |
local alx_os |
425 |
local alx_utils |
local alx_utils |
426 |
alx_os="$(< /etc/mageversion)" |
alx_os="$(< /etc/mageversion)" |
427 |
alx_utils="$(magequery -n alxconfig-ng-alx | sed 's:.*\[\ \(.*\)\ \].*:\1:')" |
alx_utils="$(magequery -n alxconfig-ng | sed 's:.*\[\ \(.*\)\ \].*:\1:')" |
428 |
alx_utils="${alx_utils/alxconfig-ng-alx-}" |
alx_utils="${alx_utils/alxconfig-ng-}" |
429 |
mysqldo "insert into client_version(serial,os,utils) values('${ALX_SERIAL}','${alx_os}','${alx_utils}')" |
mysqldo "insert into client_version(serial,os,utils) values('${ALX_SERIAL}','${alx_os}','${alx_utils}')" |
430 |
|
|
431 |
evaluate_retval |
evaluate_retval |
555 |
then |
then |
556 |
# set an device alias for modprobe.conf |
# set an device alias for modprobe.conf |
557 |
[ ! -d /etc/modprobe.d ] && install -d /etc/modprobe.d |
[ ! -d /etc/modprobe.d ] && install -d /etc/modprobe.d |
558 |
echo "alias eth0 ${NETCARD_DRIVER}" > /etc/modprobe.d/net.eth0.conf |
# update only if not the same (to speed up bootprocess - no depmod) |
559 |
|
CONFIG="/etc/modprobe.d/net.${ALX_IFACE}.conf" |
560 |
|
clearconfig |
561 |
|
addconfig "alias ${ALX_IFACE} ${cfg_network_module}" |
562 |
|
|
563 |
|
# update confd-networking default iface |
564 |
|
[ ! -d ${SETTINGSPATH} ] && install -d ${SETTINGSPATH} |
565 |
|
CONFIG="${SETTINGSPATH}/confd-networking" |
566 |
|
clearconfig |
567 |
|
addconfig "${ALX_IFACE}" |
568 |
|
|
569 |
# regenerate modprobe.conf |
# regenerate modprobe.conf |
570 |
[ -x $(which modules-update) ] && modules-update || rc_echo "modules-update not found!" |
[ -x $(which modules-update) ] && modules-update || rc_echo "modules-update not found!" |
747 |
${rc_base}/init.d/network start |
${rc_base}/init.d/network start |
748 |
else |
else |
749 |
rc_print "Starting default dhcp based networking ... " |
rc_print "Starting default dhcp based networking ... " |
750 |
${ALX_DHCP_PROG} ${ALX_DHCP_START} &> /dev/null |
${ALX_DHCP_PROG} ${ALX_DHCP_START} ${ALX_IFACE} &> /dev/null |
751 |
evaluate_retval |
evaluate_retval |
752 |
fi |
fi |
753 |
;; |
;; |
778 |
reset_system_settings() |
reset_system_settings() |
779 |
{ |
{ |
780 |
# force load of de kbdkeys |
# force load of de kbdkeys |
781 |
loadkeys -q de |
[ -x /usr/bin/loadkeys ] && loadkeys -q de |
782 |
|
[ -x /sbin/loadkmap ] && loadkmap < /usr/share/busybox/keymaps/de.kmap |
783 |
rc_echo |
rc_echo |
784 |
rc_echo -en ${COLRED} |
rc_echo -en "${COLRED}" |
785 |
rc_echo -n "*** Warning: you are about to reset *all* local settings on this system!" |
rc_echo -n '--- Warning: you are about to reset *all* local settings on this system!' |
786 |
rc_echo -e ${COLDEFAULT} |
rc_echo -e "${COLDEFAULT}" |
787 |
rc_echo "*** Do you really want to continue ?" |
rc_echo '--- Do you really want to continue ?' |
788 |
rc_echo -n "*** Enter 'yes' to continue, anything else to abort: " |
rc_echo -n '--- Enter 'yes' to continue, anything else to abort: ' |
789 |
read kbinsert |
read kbinsert |
790 |
if [[ ${kbinsert} = yes ]] |
if [[ ${kbinsert} = yes ]] |
791 |
then |
then |
792 |
rc_echo -en ${COLRED} |
rc_echo -en "${COLRED}" |
793 |
rc_echo -n "*** OK, you really want it ... killing all settings: " |
rc_echo -n '--- OK, you really want it ... killing all settings: ' |
794 |
for i in 3 2 1 now |
for i in 3 2 1 now |
795 |
do |
do |
796 |
rc_echo -n " ${i}" |
rc_echo -n " ${i}" |
797 |
sleep 1 |
sleep 1 |
798 |
done |
done |
799 |
rc_echo -e ${COLDEFAULT} |
rc_echo -e "${COLDEFAULT}" |
800 |
|
|
801 |
## reset all settings: |
## reset all settings: |
802 |
rm -rf ${SETTINGSPATH}/* |
rm -rf ${SETTINGSPATH} |
803 |
rm -f /etc/alxconfig-ng/serial |
rm -f /etc/alxconfig-ng/serial |
804 |
rm -rf /etc/alxconfig-ng/state |
rm -rf /etc/alxconfig-ng/state |
805 |
|
|
813 |
[ -d ${ALX_UNPRIV_HOME} ] && rm -rf ${ALX_UNPRIV_HOME} |
[ -d ${ALX_UNPRIV_HOME} ] && rm -rf ${ALX_UNPRIV_HOME} |
814 |
|
|
815 |
# remove all ica-sessions |
# remove all ica-sessions |
816 |
find ${ALX_ICA_SESSIONS} -type f -name '*.ica' | xargs rm |
find ${ALX_ICA_SESSIONS} -type f -name '*.ica' | xargs --no-run-if-empty rm |
817 |
|
|
818 |
# remove all old nics and modules configs |
# remove all old nics and modules configs |
819 |
find /etc/conf.d -type f -name 'net.*' | xargs rm |
find /etc/conf.d -type f -name 'net.*' | xargs --no-run-if-empty rm |
820 |
find /etc/modprobe.d -type f -name 'net.*' | xargs rm |
find /etc/modprobe.d -type f -name 'net.*' | xargs --no-run-if-empty rm |
821 |
|
|
822 |
# restore default networking |
# restore default networking |
823 |
cat ${ALX_SKELETONS}/net/net.eth0 > /etc/conf.d/net.eth0 |
cat ${ALX_SKELETONS}/net/net.eth0 > /etc/conf.d/net.eth0 |