Magellan Linux

Diff of /alx-src/branches/alxconf-060/init.d/alxsettings

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2786 by niro, Fri Aug 26 12:26:55 2011 UTC revision 3466 by niro, Fri Apr 13 17:27:25 2012 UTC
# Line 87  update_system_settings() Line 87  update_system_settings()
87    
88  get_system_serial()  get_system_serial()
89  {  {
90   local CUR_IP CUR_MAC CUR_MTIME ALX_IFACE   local CUR_IP CUR_MAC CUR_MTIME ALX_IFACE CONFIG
91    
92   if [[ ${ALX_CONFD_NETWORKING} = true ]]   if [[ ${ALX_CONFD_NETWORKING} = true ]]
93   then   then
# Line 129  get_system_serial() Line 129  get_system_serial()
129   else   else
130   # abort on non valid serial   # abort on non valid serial
131   ALX_STATE="invalid serial"   ALX_STATE="invalid serial"
132   echo "ALX_STATE=\"${ALX_STATE}\"" > /etc/alxconfig-ng/state/state   CONFIG="/etc/alxconfig-ng/state/state"
133     clearconfig
134     addconfig "ALX_STATE=\"${ALX_STATE}\""
135   show_invalid_serial_msg   show_invalid_serial_msg
136   exit 1   exit 1
137   fi   fi
# Line 155  get_system_serial() Line 157  get_system_serial()
157   HOSTNAME="${ALX_DEFAULT_HOSTNAME}"   HOSTNAME="${ALX_DEFAULT_HOSTNAME}"
158    
159   # update the hostname on the system for sure   # update the hostname on the system for sure
160   echo "${HOSTNAME}" > /etc/hostname   CONFIG="/etc/hostname"
161     clearconfig
162     addconfig "${HOSTNAME}"
163    
164   # start preliminary networking (dhcp)   # start preliminary networking (dhcp)
165   preliminary_network start   preliminary_network start
# Line 168  get_system_serial() Line 172  get_system_serial()
172   exit 1   exit 1
173   fi   fi
174    
   
175   CUR_IP=$(/sbin/ifconfig ${ALX_IFACE} | sed -n '/addr:/s/ [^r]*..//gp')   CUR_IP=$(/sbin/ifconfig ${ALX_IFACE} | sed -n '/addr:/s/ [^r]*..//gp')
176   CUR_MAC=$(/sbin/ifconfig ${ALX_IFACE} | grep HWaddr | cut -d ' ' -f11)   CUR_MAC=$(/sbin/ifconfig ${ALX_IFACE} | grep HWaddr | cut -d ' ' -f11)
177   CUR_MTIME=$(date +%s)   CUR_MTIME=$(date +%s)
# Line 192  get_system_serial() Line 195  get_system_serial()
195   else   else
196   # abort on non valid serial   # abort on non valid serial
197   ALX_STATE="invalid serial"   ALX_STATE="invalid serial"
198   echo "ALX_STATE=${ALX_STATE}" > /etc/alxconfig-ng/state/state   CONFIG="/etc/alxconfig-ng/state/state"
199     clearconfig
200     addconfig "ALX_STATE=\"${ALX_STATE}\""
201   show_invalid_serial_msg   show_invalid_serial_msg
202   exit 1   exit 1
203   fi   fi
204    
205   # write current state to temp file   # write current state to temp file
206   echo "ALX_STATE=\"${ALX_STATE}\"" > /etc/alxconfig-ng/state/state   CONFIG="/etc/alxconfig-ng/state/state"
207     clearconfig
208     addconfig "ALX_STATE=\"${ALX_STATE}\""
209   [ -f /hardware-auto-detection ] && rm /hardware-auto-detection   [ -f /hardware-auto-detection ] && rm /hardware-auto-detection
210    
211   # now export ALX_FORCED_RECHECK=true   # now export ALX_FORCED_RECHECK=true
# Line 223  get_system_serial() Line 230  get_system_serial()
230   # set ALX_STATE to ok so everybody knows that everything was ok   # set ALX_STATE to ok so everybody knows that everything was ok
231   ALX_STATE=ok   ALX_STATE=ok
232    
233   echo "ALX_SERIAL=\"${ALX_SERIAL}\"" > /etc/alxconfig-ng/serial   CONFIG="/etc/alxconfig-ng/serial"
234   echo "ALX_REG_DATE=\"${CUR_MTIME}\"" >> /etc/alxconfig-ng/serial   clearconfig
235     addconfig "ALX_SERIAL=\"${ALX_SERIAL}\""
236     addconfig "ALX_REG_DATE=\"${CUR_MTIME}\""
237    
238   evaluate_retval   evaluate_retval
239   else   else
# Line 243  get_system_serial() Line 252  get_system_serial()
252   fi   fi
253    
254   # write current state to temp file   # write current state to temp file
255   echo "ALX_STATE=\"${ALX_STATE}\"" > /etc/alxconfig-ng/state/state   CONFIG="/etc/alxconfig-ng/state/state"
256   echo "ALX_IFACE=\"${ALX_IFACE}\"" >> /etc/alxconfig-ng/state/state   clearconfig
257     addconfig "ALX_STATE=\"${ALX_STATE}\""
258     addconfig "ALX_IFACE=\"${ALX_IFACE}\""
259  }  }
260    
261    
# Line 778  preliminary_network() Line 789  preliminary_network()
789  reset_system_settings()  reset_system_settings()
790  {  {
791   # force load of de kbdkeys   # force load of de kbdkeys
792   loadkeys -q de   [ -x /usr/bin/loadkeys ] && loadkeys -q de
793     [ -x /sbin/loadkmap ] && loadkmap < /usr/share/busybox/keymaps/de.kmap
794   rc_echo   rc_echo
795   rc_echo -en ${COLRED}   rc_echo -en "${COLRED}"
796   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!'
797   rc_echo -e ${COLDEFAULT}   rc_echo -e "${COLDEFAULT}"
798   rc_echo "*** Do you really want to continue ?"   rc_echo '--- Do you really want to continue ?'
799   rc_echo -n "*** Enter 'yes' to continue, anything else to abort: "   rc_echo -n '--- Enter 'yes' to continue, anything else to abort: '
800   read kbinsert   read kbinsert
801   if [[ ${kbinsert} = yes ]]   if [[ ${kbinsert} = yes ]]
802   then   then
803   rc_echo -en ${COLRED}   rc_echo -en "${COLRED}"
804   rc_echo -n "*** OK, you really want it ... killing all settings: "   rc_echo -n '--- OK, you really want it ... killing all settings: '
805   for i in 3 2 1 now   for i in 3 2 1 now
806   do   do
807   rc_echo -n " ${i}"   rc_echo -n " ${i}"
808   sleep 1   sleep 1
809   done   done
810   rc_echo -e ${COLDEFAULT}   rc_echo -e "${COLDEFAULT}"
811    
812   ## reset all settings:   ## reset all settings:
813   rm -rf ${SETTINGSPATH}/*   rm -rf ${SETTINGSPATH}
814   rm -f /etc/alxconfig-ng/serial   rm -f /etc/alxconfig-ng/serial
815   rm -rf /etc/alxconfig-ng/state   rm -rf /etc/alxconfig-ng/state
816     local i
817     for i in xserver netcard knoppix mouse
818     do
819     [[ -f /etc/conf.d/hwsetup/${i} ]] && rm /etc/conf.d/hwsetup/${i}
820     done
821    
822   # clear all printers & net-shares   # clear all printers & net-shares
823   :> /etc/printcap   :> /etc/printcap
824    
825   # remove lprng   # remove lprng
826   rc-config del lprng &> /dev/null   rc-config del lprng &> /dev/null
827     rc-config del nmbd &> /dev/null
828    
829   # remove all user settings   # remove all user settings
830   [ -d ${ALX_UNPRIV_HOME} ] && rm -rf ${ALX_UNPRIV_HOME}   [ -d ${ALX_UNPRIV_HOME} ] && rm -rf ${ALX_UNPRIV_HOME}
831     install -o ${ALX_UNPRIV_USER} -g ${ALX_UNPRIV_GROUP} -d ${ALX_UNPRIV_HOME}
832    
833   # remove all ica-sessions   # remove all ica-sessions
834   find ${ALX_ICA_SESSIONS} -type f -name '*.ica' | xargs rm   find ${ALX_ICA_SESSIONS} -type f -name '*.ica' | xargs --no-run-if-empty rm
835    
836   # remove all old nics and modules configs   # remove all old nics and modules configs
837   find /etc/conf.d -type f -name 'net.*' | xargs rm   find /etc/conf.d -type f -name 'net.*' | xargs --no-run-if-empty rm
838   find /etc/modprobe.d -type f -name 'net.*' | xargs rm   find /etc/modprobe.d -type f -name 'net.*' | xargs --no-run-if-empty rm
839    
840   # restore default networking   # restore default networking
841   cat ${ALX_SKELETONS}/net/net.eth0 > /etc/conf.d/net.eth0   cat ${ALX_SKELETONS}/net/net.eth0 > /etc/conf.d/net.eth0
842     local CONFIG="/etc/hostname"
843     clearconfig
844     addconfig "${ALX_DEFAULT_HOSTNAME}"
845    
846   rc_echo "I am done now, press [Enter] to reboot system ..."   rc_echo -n "I am done now, press [Enter] to reboot system ..."
847   else   else
848   rc_echo "Aborted, press [Enter] to reboot system ..."   rc_echo -n "Aborted, press [Enter] to reboot system ..."
849   fi   fi
850   read   read
851   reboot   sync
852     mount -oremount,ro /
853     reboot -f
854  }  }
855    
856  onboot_interface_list()  onboot_interface_list()

Legend:
Removed from v.2786  
changed lines
  Added in v.3466