Skip to content

Commit cea8e88

Browse files
committed
Standarize files folder with dos2unix
1 parent 844a1a4 commit cea8e88

18 files changed

Lines changed: 2204 additions & 2204 deletions

files/common/etc/20-sd-universal

Lines changed: 64 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,64 @@
1-
#!/bin/bash
2-
# this script fix the nano mechanism of usb\30-sd -> block\20-sd - by DSR!
3-
4-
device=`basename $DEVPATH`
5-
devNum=$(echo $device | awk -F "" '{print $4}')
6-
7-
[[ $ACTION == "add" ]] && {
8-
mkdir -p /dev/sdcard
9-
mkdir -p /sd
10-
11-
[[ $devNum == "" ]] && {
12-
rm -rf /dev/sdcard/sd
13-
ln -s /dev/$device /dev/sdcard/sd
14-
} || {
15-
rm -rf /dev/sdcard/sd$devNum
16-
ln -s /dev/$device /dev/sdcard/sd$devNum
17-
18-
[[ $devNum == "1" ]] && {
19-
logger "== Add pendrive as SD"
20-
umount /sd
21-
mount /dev/sdcard/sd$devNum /sd && {
22-
[[ -e "/sd/etc" ]] || {
23-
sleep 5
24-
ln -s /etc/ /sd/etc
25-
}
26-
}
27-
28-
if [[ -e "/sd/modules/" ]]; then
29-
logger "== Link modules in /sd/modules/"
30-
for module in `ls /sd/modules/`; do
31-
if [[ ! -d "/pineapple/modules/$module" ]]; then
32-
ln -s /sd/modules/$module /pineapple/modules/$module
33-
fi
34-
done
35-
fi
36-
37-
# autoinstall python in universal flavor
38-
if [[ ! -d "/usr/lib/python2.7" && ! -d "/sd/usr/lib/python2.7" ]]; then
39-
/usr/bin/wpc-tools missing_packages
40-
fi
41-
}
42-
43-
[[ $devNum == "2" ]] && {
44-
logger "== Add swap"
45-
swapoff /dev/sdcard/sd$devNum
46-
swapon /dev/sdcard/sd$devNum
47-
}
48-
}
49-
}
50-
51-
[[ $ACTION == "remove" ]] && {
52-
[[ $devNum == "" ]] && {
53-
umount /sd
54-
rm -rf /dev/sdcard/sd
55-
}
56-
57-
[[ $devNum == "1" ]] && {
58-
rm -rf /dev/sdcard/sd$devNum
59-
}
60-
61-
[[ $devNum == "2" ]] && {
62-
swapoff /dev/sdcard/sd$devNum
63-
}
64-
}
1+
#!/bin/bash
2+
# this script fix the nano mechanism of usb\30-sd -> block\20-sd - by DSR!
3+
4+
device=`basename $DEVPATH`
5+
devNum=$(echo $device | awk -F "" '{print $4}')
6+
7+
[[ $ACTION == "add" ]] && {
8+
mkdir -p /dev/sdcard
9+
mkdir -p /sd
10+
11+
[[ $devNum == "" ]] && {
12+
rm -rf /dev/sdcard/sd
13+
ln -s /dev/$device /dev/sdcard/sd
14+
} || {
15+
rm -rf /dev/sdcard/sd$devNum
16+
ln -s /dev/$device /dev/sdcard/sd$devNum
17+
18+
[[ $devNum == "1" ]] && {
19+
logger "== Add pendrive as SD"
20+
umount /sd
21+
mount /dev/sdcard/sd$devNum /sd && {
22+
[[ -e "/sd/etc" ]] || {
23+
sleep 5
24+
ln -s /etc/ /sd/etc
25+
}
26+
}
27+
28+
if [[ -e "/sd/modules/" ]]; then
29+
logger "== Link modules in /sd/modules/"
30+
for module in `ls /sd/modules/`; do
31+
if [[ ! -d "/pineapple/modules/$module" ]]; then
32+
ln -s /sd/modules/$module /pineapple/modules/$module
33+
fi
34+
done
35+
fi
36+
37+
# autoinstall python in universal flavor
38+
if [[ ! -d "/usr/lib/python2.7" && ! -d "/sd/usr/lib/python2.7" ]]; then
39+
/usr/bin/wpc-tools missing_packages
40+
fi
41+
}
42+
43+
[[ $devNum == "2" ]] && {
44+
logger "== Add swap"
45+
swapoff /dev/sdcard/sd$devNum
46+
swapon /dev/sdcard/sd$devNum
47+
}
48+
}
49+
}
50+
51+
[[ $ACTION == "remove" ]] && {
52+
[[ $devNum == "" ]] && {
53+
umount /sd
54+
rm -rf /dev/sdcard/sd
55+
}
56+
57+
[[ $devNum == "1" ]] && {
58+
rm -rf /dev/sdcard/sd$devNum
59+
}
60+
61+
[[ $devNum == "2" ]] && {
62+
swapoff /dev/sdcard/sd$devNum
63+
}
64+
}

files/common/etc/30-fix_wifi

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
#!/bin/bash
2-
3-
[[ $ACTION == "remove" ]] && exit
4-
[[ $DEVTYPE == "usb_interface" ]] || exit
5-
6-
wifi config >> /etc/config/wireless
7-
WIFIDEV=$(uci show wireless | grep "${DEVPATH:9}" | awk -F'.' '{print $2}')
8-
9-
[[ ! -z $WIFIDEV ]] && {
10-
wifi reload $WIFIDEV
11-
wifi up $WIFIDEV
12-
}
1+
#!/bin/bash
2+
3+
[[ $ACTION == "remove" ]] && exit
4+
[[ $DEVTYPE == "usb_interface" ]] || exit
5+
6+
wifi config >> /etc/config/wireless
7+
WIFIDEV=$(uci show wireless | grep "${DEVPATH:9}" | awk -F'.' '{print $2}')
8+
9+
[[ ! -z $WIFIDEV ]] && {
10+
wifi reload $WIFIDEV
11+
wifi up $WIFIDEV
12+
}

files/common/etc/90-firewall.sh

Lines changed: 94 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -1,94 +1,94 @@
1-
# -- Setup firewall configuration
2-
uci set firewall.@defaults[0].syn_flood=1
3-
uci set firewall.@defaults[0].input=ACCEPT
4-
uci set firewall.@defaults[0].output=ACCEPT
5-
uci set firewall.@defaults[0].forward=ACCEPT
6-
7-
uci add firewall zone
8-
uci set firewall.@zone[-1]=zone
9-
uci set firewall.@zone[-1].name=usb
10-
uci add_list firewall.@zone[-1].network='usb'
11-
uci set firewall.@zone[-1].input=ACCEPT
12-
uci set firewall.@zone[-1].output=ACCEPT
13-
uci set firewall.@zone[-1].forward=ACCEPT
14-
uci set firewall.@zone[-1].masq=1
15-
uci set firewall.@zone[-1].mtu_fix=1
16-
17-
uci add firewall forwarding
18-
uci set firewall.@forwarding[-1].src=lan
19-
uci set firewall.@forwarding[-1].dest=usb
20-
21-
uci add firewall forwarding
22-
uci set firewall.@forwarding[-1].src=usb
23-
uci set firewall.@forwarding[-1].dest=lan
24-
25-
uci add firewall zone
26-
uci set firewall.@zone[-1]=zone
27-
uci set firewall.@zone[-1].name=wwan
28-
uci add_list firewall.@zone[-1].network=wwan
29-
uci add_list firewall.@zone[-1].network=wwan6
30-
uci set firewall.@zone[-1].input=ACCEPT
31-
uci set firewall.@zone[-1].output=ACCEPT
32-
uci set firewall.@zone[-1].forward=ACCEPT
33-
uci set firewall.@zone[-1].masq=1
34-
uci set firewall.@zone[-1].mtu_fix=1
35-
36-
uci add firewall forwarding
37-
uci set firewall.@forwarding[-1].src=lan
38-
uci set firewall.@forwarding[-1].dest=wwan
39-
40-
uci add firewall forwarding
41-
uci set firewall.@forwarding[-1].src=wwan
42-
uci set firewall.@forwarding[-1].dest=lan
43-
44-
uci add firewall zone
45-
uci set firewall.@zone[-1].name=wan
46-
uci add_list firewall.@zone[-1].network='wan'
47-
uci add_list firewall.@zone[-1].network='wan6'
48-
uci set firewall.@zone[-1].input=ACCEPT
49-
uci set firewall.@zone[-1].output=ACCEPT
50-
uci set firewall.@zone[-1].forward=ACCEPT
51-
uci set firewall.@zone[-1].masq=1
52-
uci set firewall.@zone[-1].mtu_fix=1
53-
54-
uci add firewall forwarding
55-
uci set firewall.@forwarding[-1].src=lan
56-
uci set firewall.@forwarding[-1].dest=wan
57-
58-
uci add firewall forwarding
59-
uci set firewall.@forwarding[-1].src=wan
60-
uci set firewall.@forwarding[-1].dest=lan
61-
62-
uci add firewall allowssh
63-
uci set firewall.allowssh=rule
64-
uci set firewall.allowssh.name='Allow-SSH'
65-
uci set firewall.allowssh.src='wan'
66-
uci set firewall.allowssh.proto='tcp'
67-
uci set firewall.allowssh.dest_port='22'
68-
uci set firewall.allowssh.target='ACCEPT'
69-
uci set firewall.allowssh.family='ipv4'
70-
uci set firewall.allowssh.enabled='0'
71-
72-
uci add firewall allowui
73-
uci set firewall.allowui=rule
74-
uci set firewall.allowui.name='Allow-WEB'
75-
uci set firewall.allowui.src='wan'
76-
uci set firewall.allowui.proto='tcp'
77-
uci set firewall.allowui.dest_port='1471'
78-
uci set firewall.allowui.target='ACCEPT'
79-
uci set firewall.allowui.family='ipv4'
80-
uci set firewall.allowui.enabled='0'
81-
82-
uci add firewall allowws
83-
uci set firewall.allowws=rule
84-
uci set firewall.allowws.name='Allow-WEB-WS'
85-
uci set firewall.allowws.src='wan'
86-
uci set firewall.allowws.proto='tcp'
87-
uci set firewall.allowws.dest_port='1337'
88-
uci set firewall.allowws.target='ACCEPT'
89-
uci set firewall.allowws.family='ipv4'
90-
uci set firewall.allowws.enabled='1'
91-
92-
uci commit firewall
93-
94-
exit 0
1+
# -- Setup firewall configuration
2+
uci set firewall.@defaults[0].syn_flood=1
3+
uci set firewall.@defaults[0].input=ACCEPT
4+
uci set firewall.@defaults[0].output=ACCEPT
5+
uci set firewall.@defaults[0].forward=ACCEPT
6+
7+
uci add firewall zone
8+
uci set firewall.@zone[-1]=zone
9+
uci set firewall.@zone[-1].name=usb
10+
uci add_list firewall.@zone[-1].network='usb'
11+
uci set firewall.@zone[-1].input=ACCEPT
12+
uci set firewall.@zone[-1].output=ACCEPT
13+
uci set firewall.@zone[-1].forward=ACCEPT
14+
uci set firewall.@zone[-1].masq=1
15+
uci set firewall.@zone[-1].mtu_fix=1
16+
17+
uci add firewall forwarding
18+
uci set firewall.@forwarding[-1].src=lan
19+
uci set firewall.@forwarding[-1].dest=usb
20+
21+
uci add firewall forwarding
22+
uci set firewall.@forwarding[-1].src=usb
23+
uci set firewall.@forwarding[-1].dest=lan
24+
25+
uci add firewall zone
26+
uci set firewall.@zone[-1]=zone
27+
uci set firewall.@zone[-1].name=wwan
28+
uci add_list firewall.@zone[-1].network=wwan
29+
uci add_list firewall.@zone[-1].network=wwan6
30+
uci set firewall.@zone[-1].input=ACCEPT
31+
uci set firewall.@zone[-1].output=ACCEPT
32+
uci set firewall.@zone[-1].forward=ACCEPT
33+
uci set firewall.@zone[-1].masq=1
34+
uci set firewall.@zone[-1].mtu_fix=1
35+
36+
uci add firewall forwarding
37+
uci set firewall.@forwarding[-1].src=lan
38+
uci set firewall.@forwarding[-1].dest=wwan
39+
40+
uci add firewall forwarding
41+
uci set firewall.@forwarding[-1].src=wwan
42+
uci set firewall.@forwarding[-1].dest=lan
43+
44+
uci add firewall zone
45+
uci set firewall.@zone[-1].name=wan
46+
uci add_list firewall.@zone[-1].network='wan'
47+
uci add_list firewall.@zone[-1].network='wan6'
48+
uci set firewall.@zone[-1].input=ACCEPT
49+
uci set firewall.@zone[-1].output=ACCEPT
50+
uci set firewall.@zone[-1].forward=ACCEPT
51+
uci set firewall.@zone[-1].masq=1
52+
uci set firewall.@zone[-1].mtu_fix=1
53+
54+
uci add firewall forwarding
55+
uci set firewall.@forwarding[-1].src=lan
56+
uci set firewall.@forwarding[-1].dest=wan
57+
58+
uci add firewall forwarding
59+
uci set firewall.@forwarding[-1].src=wan
60+
uci set firewall.@forwarding[-1].dest=lan
61+
62+
uci add firewall allowssh
63+
uci set firewall.allowssh=rule
64+
uci set firewall.allowssh.name='Allow-SSH'
65+
uci set firewall.allowssh.src='wan'
66+
uci set firewall.allowssh.proto='tcp'
67+
uci set firewall.allowssh.dest_port='22'
68+
uci set firewall.allowssh.target='ACCEPT'
69+
uci set firewall.allowssh.family='ipv4'
70+
uci set firewall.allowssh.enabled='0'
71+
72+
uci add firewall allowui
73+
uci set firewall.allowui=rule
74+
uci set firewall.allowui.name='Allow-WEB'
75+
uci set firewall.allowui.src='wan'
76+
uci set firewall.allowui.proto='tcp'
77+
uci set firewall.allowui.dest_port='1471'
78+
uci set firewall.allowui.target='ACCEPT'
79+
uci set firewall.allowui.family='ipv4'
80+
uci set firewall.allowui.enabled='0'
81+
82+
uci add firewall allowws
83+
uci set firewall.allowws=rule
84+
uci set firewall.allowws.name='Allow-WEB-WS'
85+
uci set firewall.allowws.src='wan'
86+
uci set firewall.allowws.proto='tcp'
87+
uci set firewall.allowws.dest_port='1337'
88+
uci set firewall.allowws.target='ACCEPT'
89+
uci set firewall.allowws.family='ipv4'
90+
uci set firewall.allowws.enabled='1'
91+
92+
uci commit firewall
93+
94+
exit 0

files/common/etc/92-system.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# -- Setup system configuration
2-
3-
# Change the hostname
4-
uci set system.@system[0].hostname=Pineapple
5-
uci commit system
6-
echo $(uci get system.@system[0].hostname) > /proc/sys/kernel/hostname
7-
8-
exit 0
1+
# -- Setup system configuration
2+
3+
# Change the hostname
4+
uci set system.@system[0].hostname=Pineapple
5+
uci commit system
6+
echo $(uci get system.@system[0].hostname) > /proc/sys/kernel/hostname
7+
8+
exit 0

0 commit comments

Comments
 (0)