Changeset 428f140 in freewrt
- Timestamp:
- Jul 18, 2006, 7:40:28 AM (19 years ago)
- Branches:
- freewrt_1_0, freewrt_2_0
- Children:
- c78941a
- Parents:
- 8107adb
- Location:
- package
- Files:
-
- 2 added
- 2 edited
-
base-files/default/etc/functions.sh (modified) (1 diff)
-
base-files/default/etc/rc.conf (modified) (1 diff)
-
dropbear/ipkg/dropbear.postinst (added)
-
iptables/ipkg/iptables.postinst (added)
Legend:
- Unmodified
- Added
- Removed
-
package/base-files/default/etc/functions.sh
r8107adb r428f140 92 92 sed 's/^[^#]/insmod &/' $* | ash 2>&- || : 93 93 } 94 95 user_exists() { 96 grep -q "^$1:" $IPKG_INSTROOT/etc/passwd 2>&- 97 } 98 99 group_exists() { 100 grep -q "^$1:" $IPKG_INSTROOT/etc/group 2>&- 101 } 102 103 service_exists() { 104 grep -q "^$1[[:space:]]*$2" $IPKG_INSTROOT/etc/services 2>&- 105 } 106 107 rcconf_exists() { 108 grep -q "$1" $IPKG_INSTROOT/etc/rc.conf 2>&- 109 } 110 111 add_user() { 112 user_exists $1 || { 113 echo "adding user $1 to /etc/passwd" 114 echo "$1:x:$2:${3:-$2}:$1:${4:-/tmp}:${5:-/bin/false}" >> \ 115 $IPKG_INSTROOT/etc/passwd 116 } 117 } 118 119 add_group() { 120 group_exists $1 || { 121 echo "adding group $1 to /etc/group" 122 echo "$1:x:$2:$3" >> $IPKG_INSTROOT/etc/group 123 } 124 } 125 126 add_service() { 127 service_exists $1 $2 || { 128 echo "adding service $1 to /etc/services" 129 echo -e "$1\t$2" >> $IPKG_INSTROOT/etc/services 130 } 131 } 132 133 add_rcconf() { 134 rcconf_exists $1 $2 || { 135 echo "adding service $1 to /etc/rc.conf" 136 echo -e "$2" >> $IPKG_INSTROOT/etc/rc.conf 137 } 138 } 139 140 get_next_uid() { 141 uid=$(cat $IPKG_INSTROOT/etc/passwd | grep -v ^nobody \ 142 | grep -v ^admin | \ 143 tail -n 1 | awk -F : '{ print $3 }') 144 let uid=$uid+1 145 echo $uid 146 } 147 148 get_next_gid() { 149 gid=$(cat $IPKG_INSTROOT/etc/group | grep -v ^nogroup \ 150 | grep -v ^admin | \ 151 tail -n 1 | awk -F : '{ print $3 }') 152 let gid=$gid+1 153 echo $gid 154 } -
package/base-files/default/etc/rc.conf
r8107adb r428f140 1 1 #!/bin/sh 2 # $Id$3 4 2 # set the following to "YES" to turn them on 5 ssh=YES6 dns_dhcp=YES7 firewall=NO
Note:
See TracChangeset
for help on using the changeset viewer.
