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 |
echo -e ${COLMAGENTA}"Checking system setup ..."${COLDEFAULT} |
rc_mecho Checking system setup ... |
57 |
|
|
58 |
# get the modules settings |
# get the modules settings |
59 |
# ! is the first thing that must be configured ! |
# ! is the first thing that must be configured ! |
574 |
# now generate fluxbox config files |
# now generate fluxbox config files |
575 |
|
|
576 |
# fluxbox main config |
# fluxbox main config |
577 |
cat ${ALX_SKELETONS}/fluxbox/init > ${ALX_UNPRIV_HOME}/.fluxbox/init |
local fbinit |
578 |
|
if [ -f ${ALX_SKELETONS}/fluxbox/init ] |
579 |
|
then |
580 |
|
fbinit="${ALX_SKELETONS}/fluxbox/init" |
581 |
|
else |
582 |
|
fbinit="/usr/share/fluxbox/init" |
583 |
|
fi |
584 |
|
cat ${fbinit} > ${ALX_UNPRIV_HOME}/.fluxbox/init |
585 |
|
|
586 |
# fluxbox autostart |
# fluxbox autostart |
587 |
cat ${ALX_SKELETONS}/fluxbox/apps > ${ALX_UNPRIV_HOME}/.fluxbox/apps |
CONFIG="${ALX_UNPRIV_HOME}/.fluxbox/apps" |
588 |
|
# do not show decorations on messages generated with xmessage |
589 |
|
if [ -x /usr/bin/xmessage ] |
590 |
|
then |
591 |
|
addconfig '[app] (xmessage)' |
592 |
|
addconfig ' [Deco] {NONE}' |
593 |
|
addconfig '[end]' |
594 |
|
fi |
595 |
|
# add icon utility |
596 |
|
[ -x /usr/bin/idesk ] && addconfig '[startup] {nohup idesk > /dev/null &}' |
597 |
|
# add numlock utility |
598 |
|
[ -x /usr/bin/numlockx ] && addconfig '[startup] {nohup numlockx on &}' |
599 |
|
|
600 |
|
# fluxbox hotkeys |
601 |
|
local fbkeys |
602 |
|
if [ -f ${ALX_SKELETONS}/fluxbox/keys ] |
603 |
|
then |
604 |
|
fbkeys="${ALX_SKELETONS}/fluxbox/keys" |
605 |
|
else |
606 |
|
fbkeys="/usr/share/fluxbox/keys" |
607 |
|
fi |
608 |
|
cat ${fbkeys} > ${ALX_UNPRIV_HOME}/.fluxbox/keys |
609 |
|
|
610 |
# fluxbox menu header |
# fluxbox menu header |
611 |
cat ${ALX_SKELETONS}/fluxbox/menu.header > ${ALX_UNPRIV_HOME}/.fluxbox/menu |
cat ${ALX_SKELETONS}/fluxbox/menu.header > ${ALX_UNPRIV_HOME}/.fluxbox/menu |
623 |
# add a newline (maybe there is no crlf in the footer) |
# add a newline (maybe there is no crlf in the footer) |
624 |
echo >> ${ALX_UNPRIV_HOME}/.fluxbox/menu |
echo >> ${ALX_UNPRIV_HOME}/.fluxbox/menu |
625 |
|
|
|
|
|
626 |
# setup some standart icons (sysinfo.lnk) |
# setup some standart icons (sysinfo.lnk) |
|
# basic config |
|
|
cat ${ALX_SKELETONS}/xtdesktop/xtdeskrc > ${ALX_UNPRIV_HOME}/.xtdeskrc |
|
|
|
|
627 |
# clean desktop icon location |
# clean desktop icon location |
628 |
[ -d ${ALX_UNPRIV_HOME}/.xtdesktop ] && rm -rf ${ALX_UNPRIV_HOME}/.xtdesktop |
[ -d ${ALX_UNPRIV_HOME}/.idesktop ] && rm -rf ${ALX_UNPRIV_HOME}/.idesktop |
629 |
install -d ${ALX_UNPRIV_HOME}/.xtdesktop |
install -d ${ALX_UNPRIV_HOME}/.idesktop |
630 |
|
|
631 |
|
# add shutdown, reboot icons |
632 |
|
local name |
633 |
|
# default settings |
634 |
|
declare -i x=30 |
635 |
|
declare -i y=30 |
636 |
|
for i in shutdown reboot |
637 |
|
do |
638 |
|
case ${i} in |
639 |
|
shutdown) name="Herunterfahren" ;; |
640 |
|
reboot) name="Neustarten" ;; |
641 |
|
esac |
642 |
|
|
643 |
|
generate_icon \ |
644 |
|
--name "${name}" \ |
645 |
|
--command "/usr/lib/alxconfig-ng/bin/user_${i}.sh" \ |
646 |
|
--icon "${ALX_SESSIONS_ICONS}/${i}.png" \ |
647 |
|
--dest "${dest}/${i}.lnk" \ |
648 |
|
--xres "${x}" \ |
649 |
|
--yres "${y}" |
650 |
|
|
651 |
|
y=$((${y} + 80)) |
652 |
|
done |
653 |
|
|
654 |
# last but not least gen a icon with some sys informations |
# last but not least gen a icon with some sys informations |
655 |
local sysinfo |
local sysinfo |
671 |
--name "${sysinfo}" \ |
--name "${sysinfo}" \ |
672 |
--command "exit 0" \ |
--command "exit 0" \ |
673 |
--icon "${ALX_SESSIONS_ICONS}/sysinfo.png" \ |
--icon "${ALX_SESSIONS_ICONS}/sysinfo.png" \ |
674 |
--dest "${ALX_UNPRIV_HOME}/.xtdesktop/sysinfo.lnk" \ |
--dest "${ALX_UNPRIV_HOME}/.idesktop/sysinfo.lnk" \ |
675 |
--xres "${xres}" \ |
--xres "${xres}" \ |
676 |
--yres "${yres}" \ |
--yres "${yres}" \ |
677 |
--icon-width "1" \ |
--icon-width "1" \ |
678 |
--icon-height "1" |
--icon-height "1" |
679 |
|
|
|
# create a xinitrc |
|
|
echo "exec startfluxbox" > ${ALX_UNPRIV_HOME}/.xinitrc |
|
|
|
|
680 |
# set correct permissions |
# set correct permissions |
681 |
chown ${ALX_UNPRIV_USER}:${ALX_UNPRIV_GROUP} ${ALX_UNPRIV_HOME} |
chown ${ALX_UNPRIV_USER}:${ALX_UNPRIV_GROUP} ${ALX_UNPRIV_HOME} |
682 |
chown ${ALX_UNPRIV_USER}:${ALX_UNPRIV_GROUP} ${ALX_UNPRIV_HOME}/.fluxbox |
chown ${ALX_UNPRIV_USER}:${ALX_UNPRIV_GROUP} ${ALX_UNPRIV_HOME}/.fluxbox |
683 |
chmod 0755 ${ALX_UNPRIV_HOME}/.fluxbox |
chmod 0755 ${ALX_UNPRIV_HOME}/.fluxbox |
684 |
chmod 0755 ${ALX_UNPRIV_HOME}/.xtdesktop |
chmod 0755 ${ALX_UNPRIV_HOME}/.idesktop |
685 |
chmod 0644 ${ALX_UNPRIV_HOME}/.xtdeskrc |
if [ -f ${ALX_UNPRIV_HOME}/.ideskrc ] |
686 |
chmod 0644 ${ALX_UNPRIV_HOME}/.xinitrc |
then |
687 |
|
chmod 0644 ${ALX_UNPRIV_HOME}/.ideskrc |
688 |
|
fi |
689 |
} |
} |
690 |
|
|
691 |
# start|stop |
# start|stop |
718 |
# keeping like always safe: |
# keeping like always safe: |
719 |
# no network should be startet here, |
# no network should be startet here, |
720 |
# so we can delete all pid files if one exists |
# so we can delete all pid files if one exists |
721 |
if [[ ! -z $(pidof udhcpc) ]] |
if [[ ! -z $(pidof $(basename ${ALX_DHCP_PROG})) ]] |
722 |
then |
then |
723 |
rc_mecho "Forcing network down" |
rc_mecho "Forcing network down" |
724 |
killall udhcpc &> /dev/null |
killall $(basename ${ALX_DHCP_PROG}) &> /dev/null |
725 |
sleep 1 |
sleep 1 |
726 |
fi |
fi |
727 |
[[ ${ALX_CONFD_NETWORKING} = true ]] && ${rc_base}/init.d/network stop |
[[ ${ALX_CONFD_NETWORKING} = true ]] && ${rc_base}/init.d/network stop |
734 |
${rc_base}/init.d/network start |
${rc_base}/init.d/network start |
735 |
else |
else |
736 |
rc_print "Starting default dhcp based networking ... " |
rc_print "Starting default dhcp based networking ... " |
737 |
# -t 10 timeout of 10 secs |
${ALX_DHCP_PROG} ${ALX_DHCP_START} &> /dev/null |
|
udhcpc -t 10 &> /dev/null |
|
738 |
evaluate_retval |
evaluate_retval |
739 |
fi |
fi |
740 |
;; |
;; |
746 |
${rc_base}/init.d/network stop |
${rc_base}/init.d/network stop |
747 |
else |
else |
748 |
rc_print "Stopping default dhcp based networking ... " |
rc_print "Stopping default dhcp based networking ... " |
749 |
ifconfig eth0 down |
ifconfig ${ALX_IFACE} down |
750 |
fi |
fi |
751 |
if [[ ! -z $(pidof udhcpc) ]] |
if [[ ! -z $(pidof $(basename ${ALX_DHCP_PROG})) ]] |
752 |
then |
then |
753 |
killall udhcpc &> /dev/null |
killall $(basename ${ALX_DHCP_PROG}) &> /dev/null |
754 |
sleep 1 |
sleep 1 |
755 |
fi |
fi |
756 |
evaluate_retval |
evaluate_retval |