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 |
|
local i |
806 |
|
for i in xserver netcard knoppix mouse |
807 |
|
do |
808 |
|
[[ -f /etc/conf.d/hwsetup/${i} ]] && rm /etc/conf.d/hwsetup/${i} |
809 |
|
done |
810 |
|
|
811 |
# clear all printers & net-shares |
# clear all printers & net-shares |
812 |
:> /etc/printcap |
:> /etc/printcap |
813 |
|
|
814 |
# remove lprng |
# remove lprng |
815 |
rc-config del lprng &> /dev/null |
rc-config del lprng &> /dev/null |
816 |
|
rc-config del nmbd &> /dev/null |
817 |
|
|
818 |
# remove all user settings |
# remove all user settings |
819 |
[ -d ${ALX_UNPRIV_HOME} ] && rm -rf ${ALX_UNPRIV_HOME} |
[ -d ${ALX_UNPRIV_HOME} ] && rm -rf ${ALX_UNPRIV_HOME} |
820 |
|
install -o ${ALX_UNPRIV_USER} -g ${ALX_UNPRIV_GROUP} -d ${ALX_UNPRIV_HOME} |
821 |
|
|
822 |
# remove all ica-sessions |
# remove all ica-sessions |
823 |
find ${ALX_ICA_SESSIONS} -type f -name '*.ica' | xargs --no-run-if-empty rm |
find ${ALX_ICA_SESSIONS} -type f -name '*.ica' | xargs --no-run-if-empty rm |
828 |
|
|
829 |
# restore default networking |
# restore default networking |
830 |
cat ${ALX_SKELETONS}/net/net.eth0 > /etc/conf.d/net.eth0 |
cat ${ALX_SKELETONS}/net/net.eth0 > /etc/conf.d/net.eth0 |
831 |
|
echo "${ALX_DEFAULT_HOSTNAME}" > /etc/hostname |
832 |
|
|
833 |
rc_echo "I am done now, press [Enter] to reboot system ..." |
rc_echo -n "I am done now, press [Enter] to reboot system ..." |
834 |
else |
else |
835 |
rc_echo "Aborted, press [Enter] to reboot system ..." |
rc_echo -n "Aborted, press [Enter] to reboot system ..." |
836 |
fi |
fi |
837 |
read |
read |
838 |
reboot |
reboot |