51 |
# setup needed directories |
# setup needed directories |
52 |
[ ! -d /etc/alxconfig-ng/state ] && install -d /etc/alxconfig-ng/state |
[ ! -d /etc/alxconfig-ng/state ] && install -d /etc/alxconfig-ng/state |
53 |
|
|
|
|
|
|
# read_cmdline ${item} |
|
|
read_cmdline() |
|
|
{ |
|
|
local i |
|
|
|
|
|
for i in $(< /proc/cmdline) |
|
|
do |
|
|
[[ ${i} = $1 ]] && return 0 |
|
|
done |
|
|
|
|
|
return 1 |
|
|
} |
|
|
|
|
54 |
update_system_settings() |
update_system_settings() |
55 |
{ |
{ |
56 |
rc_mecho Checking system setup ... |
rc_mecho Checking system setup ... |
165 |
fi |
fi |
166 |
|
|
167 |
|
|
168 |
CUR_IP=$(/sbin/ifconfig eth0 | sed -n '/addr:/s/ [^r]*..//gp') |
CUR_IP=$(/sbin/ifconfig ${ALX_IFACE} | sed -n '/addr:/s/ [^r]*..//gp') |
169 |
CUR_MAC=$(/sbin/ifconfig eth0 | grep HWaddr | cut -d ' ' -f11) |
CUR_MAC=$(/sbin/ifconfig ${ALX_IFACE} | grep HWaddr | cut -d ' ' -f11) |
170 |
CUR_MTIME=$(date +%s) |
CUR_MTIME=$(date +%s) |
171 |
|
|
172 |
# abort now if this is a forced re-check |
# abort now if this is a forced re-check |
420 |
local alx_os |
local alx_os |
421 |
local alx_utils |
local alx_utils |
422 |
alx_os="$(< /etc/mageversion)" |
alx_os="$(< /etc/mageversion)" |
423 |
alx_utils="$(magequery -n alxconfig-ng-alx | sed 's:.*\[\ \(.*\)\ \].*:\1:')" |
alx_utils="$(magequery -n alxconfig-ng | sed 's:.*\[\ \(.*\)\ \].*:\1:')" |
424 |
alx_utils="${alx_utils/alxconfig-ng-alx-}" |
alx_utils="${alx_utils/alxconfig-ng-}" |
425 |
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}')" |
426 |
|
|
427 |
evaluate_retval |
evaluate_retval |
551 |
then |
then |
552 |
# set an device alias for modprobe.conf |
# set an device alias for modprobe.conf |
553 |
[ ! -d /etc/modprobe.d ] && install -d /etc/modprobe.d |
[ ! -d /etc/modprobe.d ] && install -d /etc/modprobe.d |
554 |
echo "alias eth0 ${NETCARD_DRIVER}" > /etc/modprobe.d/net.eth0.conf |
# update only if not the same (to speed up bootprocess - no depmod) |
555 |
|
CONFIG="/etc/modprobe.d/net.${ALX_IFACE}.conf" |
556 |
|
clearconfig |
557 |
|
addconfig "alias ${ALX_IFACE} ${cfg_network_module}" |
558 |
|
|
559 |
|
# update confd-networking default iface |
560 |
|
[ ! -d ${SETTINGSPATH} ] && install -d ${SETTINGSPATH} |
561 |
|
CONFIG="${SETTINGSPATH}/confd-networking" |
562 |
|
clearconfig |
563 |
|
addconfig "${ALX_IFACE}" |
564 |
|
|
565 |
# regenerate modprobe.conf |
# regenerate modprobe.conf |
566 |
[ -x $(which modules-update) ] && modules-update || rc_echo "modules-update not found!" |
[ -x $(which modules-update) ] && modules-update || rc_echo "modules-update not found!" |
583 |
# now generate fluxbox config files |
# now generate fluxbox config files |
584 |
|
|
585 |
# fluxbox main config |
# fluxbox main config |
586 |
cat ${ALX_SKELETONS}/fluxbox/init > ${ALX_UNPRIV_HOME}/.fluxbox/init |
local fbinit |
587 |
|
if [ -f ${ALX_SKELETONS}/fluxbox/init ] |
588 |
|
then |
589 |
|
fbinit="${ALX_SKELETONS}/fluxbox/init" |
590 |
|
else |
591 |
|
fbinit="/usr/share/fluxbox/init" |
592 |
|
fi |
593 |
|
cat ${fbinit} > ${ALX_UNPRIV_HOME}/.fluxbox/init |
594 |
|
|
595 |
# fluxbox autostart |
# fluxbox autostart |
596 |
cat ${ALX_SKELETONS}/fluxbox/apps > ${ALX_UNPRIV_HOME}/.fluxbox/apps |
CONFIG="${ALX_UNPRIV_HOME}/.fluxbox/apps" |
597 |
|
# do not show decorations on messages generated with xmessage |
598 |
|
if [ -x /usr/bin/xmessage ] |
599 |
|
then |
600 |
|
addconfig '[app] (xmessage)' |
601 |
|
addconfig ' [Deco] {NONE}' |
602 |
|
addconfig '[end]' |
603 |
|
fi |
604 |
|
# add icon utility |
605 |
|
[ -x /usr/bin/idesk ] && addconfig '[startup] {nohup idesk > /dev/null &}' |
606 |
|
# add numlock utility |
607 |
|
[ -x /usr/bin/numlockx ] && addconfig '[startup] {nohup numlockx on &}' |
608 |
|
|
609 |
|
# fluxbox hotkeys |
610 |
|
local fbkeys |
611 |
|
if [ -f ${ALX_SKELETONS}/fluxbox/keys ] |
612 |
|
then |
613 |
|
fbkeys="${ALX_SKELETONS}/fluxbox/keys" |
614 |
|
else |
615 |
|
fbkeys="/usr/share/fluxbox/keys" |
616 |
|
fi |
617 |
|
cat ${fbkeys} > ${ALX_UNPRIV_HOME}/.fluxbox/keys |
618 |
|
|
619 |
# fluxbox menu header |
# fluxbox menu header |
620 |
cat ${ALX_SKELETONS}/fluxbox/menu.header > ${ALX_UNPRIV_HOME}/.fluxbox/menu |
cat ${ALX_SKELETONS}/fluxbox/menu.header > ${ALX_UNPRIV_HOME}/.fluxbox/menu |
634 |
|
|
635 |
# setup some standart icons (sysinfo.lnk) |
# setup some standart icons (sysinfo.lnk) |
636 |
# clean desktop icon location |
# clean desktop icon location |
637 |
[ -d ${ALX_UNPRIV_HOME}/.xtdesktop ] && rm -rf ${ALX_UNPRIV_HOME}/.xtdesktop |
[ -d ${ALX_UNPRIV_HOME}/.idesktop ] && rm -rf ${ALX_UNPRIV_HOME}/.idesktop |
638 |
install -d ${ALX_UNPRIV_HOME}/.xtdesktop |
install -d ${ALX_UNPRIV_HOME}/.idesktop |
639 |
|
|
640 |
# basic config |
# add shutdown, reboot icons |
641 |
cat ${ALX_SKELETONS}/xtdesktop/xtdeskrc > ${ALX_UNPRIV_HOME}/.xtdesktop/xtdeskrc |
local name |
642 |
|
# default settings |
643 |
|
declare -i x=30 |
644 |
|
declare -i y=30 |
645 |
|
for i in shutdown reboot |
646 |
|
do |
647 |
|
case ${i} in |
648 |
|
shutdown) name="Herunterfahren" ;; |
649 |
|
reboot) name="Neustarten" ;; |
650 |
|
esac |
651 |
|
|
652 |
|
generate_icon \ |
653 |
|
--name "${name}" \ |
654 |
|
--command "/usr/lib/alxconfig-ng/bin/user_${i}.sh" \ |
655 |
|
--icon "${ALX_SESSIONS_ICONS}/${i}.png" \ |
656 |
|
--dest "${dest}/${i}.lnk" \ |
657 |
|
--xres "${x}" \ |
658 |
|
--yres "${y}" |
659 |
|
|
660 |
|
y=$((${y} + 80)) |
661 |
|
done |
662 |
|
|
663 |
# last but not least gen a icon with some sys informations |
# last but not least gen a icon with some sys informations |
664 |
local sysinfo |
local sysinfo |
680 |
--name "${sysinfo}" \ |
--name "${sysinfo}" \ |
681 |
--command "exit 0" \ |
--command "exit 0" \ |
682 |
--icon "${ALX_SESSIONS_ICONS}/sysinfo.png" \ |
--icon "${ALX_SESSIONS_ICONS}/sysinfo.png" \ |
683 |
--dest "${ALX_UNPRIV_HOME}/.xtdesktop/sysinfo.lnk" \ |
--dest "${ALX_UNPRIV_HOME}/.idesktop/sysinfo.lnk" \ |
684 |
--xres "${xres}" \ |
--xres "${xres}" \ |
685 |
--yres "${yres}" \ |
--yres "${yres}" \ |
686 |
--icon-width "1" \ |
--icon-width "1" \ |
687 |
--icon-height "1" |
--icon-height "1" |
688 |
|
|
|
# create a xinitrc |
|
|
echo "exec startfluxbox" > ${ALX_UNPRIV_HOME}/.xinitrc |
|
|
|
|
689 |
# set correct permissions |
# set correct permissions |
690 |
chown ${ALX_UNPRIV_USER}:${ALX_UNPRIV_GROUP} ${ALX_UNPRIV_HOME} |
chown ${ALX_UNPRIV_USER}:${ALX_UNPRIV_GROUP} ${ALX_UNPRIV_HOME} |
691 |
chown ${ALX_UNPRIV_USER}:${ALX_UNPRIV_GROUP} ${ALX_UNPRIV_HOME}/.fluxbox |
chown ${ALX_UNPRIV_USER}:${ALX_UNPRIV_GROUP} ${ALX_UNPRIV_HOME}/.fluxbox |
692 |
chmod 0755 ${ALX_UNPRIV_HOME}/.fluxbox |
chmod 0755 ${ALX_UNPRIV_HOME}/.fluxbox |
693 |
chmod 0755 ${ALX_UNPRIV_HOME}/.xtdesktop |
chmod 0755 ${ALX_UNPRIV_HOME}/.idesktop |
694 |
chmod 0644 ${ALX_UNPRIV_HOME}/.xtdeskrc |
if [ -f ${ALX_UNPRIV_HOME}/.ideskrc ] |
695 |
chmod 0644 ${ALX_UNPRIV_HOME}/.xinitrc |
then |
696 |
|
chmod 0644 ${ALX_UNPRIV_HOME}/.ideskrc |
697 |
|
fi |
698 |
} |
} |
699 |
|
|
700 |
# start|stop |
# start|stop |
743 |
${rc_base}/init.d/network start |
${rc_base}/init.d/network start |
744 |
else |
else |
745 |
rc_print "Starting default dhcp based networking ... " |
rc_print "Starting default dhcp based networking ... " |
746 |
${ALX_DHCP_PROG} ${ALX_DHCP_START} &> /dev/null |
${ALX_DHCP_PROG} ${ALX_DHCP_START} ${ALX_IFACE} &> /dev/null |
747 |
evaluate_retval |
evaluate_retval |
748 |
fi |
fi |
749 |
;; |
;; |