/[vps]/baselayout-vserver/branches/baselayout-1_12/net-scripts/net.modules.d/helpers.d/functions
Gentoo

Diff of /baselayout-vserver/branches/baselayout-1_12/net-scripts/net.modules.d/helpers.d/functions

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

Revision 205 Revision 206
36save_state() { 36save_state() {
37 local iface="$1" 37 local iface="$1"
38 local d="${statedir}/${iface}" 38 local d="${statedir}/${iface}"
39 39
40 [[ ! -d ${d} ]] && mkdir -m 0755 -p "${d}" 40 [[ ! -d ${d} ]] && mkdir -m 0755 -p "${d}"
41 cp -a /etc/resolv.conf /etc/ntp.conf /etc/yp.conf "${d}" 2>/dev/null 41 cp -p /etc/resolv.conf /etc/ntp.conf /etc/yp.conf "${d}" 2>/dev/null
42} 42}
43 43
44# void remove_state(char *interface) 44# void remove_state(char *interface)
45# 45#
46# Removes state information regarding the interface 46# Removes state information regarding the interface
68 local d="${statedir}/${iface}" 68 local d="${statedir}/${iface}"
69 if [[ -d ${d} ]]; then 69 if [[ -d ${d} ]]; then
70 local files=$( ls "${d}" ) 70 local files=$( ls "${d}" )
71 if [[ -n ${files} ]] ; then 71 if [[ -n ${files} ]] ; then
72 if [[ ${RC_AUTO_INTERFACE} == "yes" ]]; then 72 if [[ ${RC_AUTO_INTERFACE} == "yes" ]]; then
73 cp -aR "${d}"/* "${netdir}" 73 cp -pPR "${d}"/* "${netdir}"
74 local file 74 local file
75 for file in ${files} ; do 75 for file in ${files} ; do
76 # Skip .sv files 76 # Skip .sv files
77 [[ ${file} == *".sv" ]] && contine 77 [[ ${file} == *".sv" ]] && contine
78 local link=$( readlink "/etc/${file}" 2>/dev/null ) 78 local link=$( readlink "/etc/${file}" 2>/dev/null )
80 [[ -e "/etc/${file}" ]] && rm -f "/etc/${file}" 80 [[ -e "/etc/${file}" ]] && rm -f "/etc/${file}"
81 ln -snf "${netdir}/${file}" "/etc/${file}" 81 ln -snf "${netdir}/${file}" "/etc/${file}"
82 fi 82 fi
83 done 83 done
84 else 84 else
85 cp -ar "${d}"/* /etc 85 cp -pPR "${d}"/* /etc
86 fi 86 fi
87 fi 87 fi
88 fi 88 fi
89 89
90 [[ ${RC_AUTO_INTERFACE} == "yes" ]] && merge_configs 90 [[ ${RC_AUTO_INTERFACE} == "yes" ]] && merge_configs

Legend:
Removed from v.205  
changed lines
  Added in v.206

  ViewVC Help
Powered by ViewVC 1.1.20