aboutsummaryrefslogtreecommitdiff
path: root/sub/layout/configure-localoptions
blob: 451fcce9a0621bfd5dfa53ad5d37e4dd121bca58 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh -e

output="$1"
countrycode="$2"
localip="$3"
routerip="$4"

case "$countrycode" in
  fr)  timezone=Europe/Paris ;;
  uk)  timezone=Europe/London ;;
  rs)  timezone=Europe/Belgrade ;;
  cn)  timezone=Asia/Shanghai ;;
  vn)  timezone=Asia/Saigon ;;
  *) echo "invalid countrycode: please choose fr, uk, rs, cn or vn" 1>&2 ; exit 100 ;;
esac

echo "$countrycode" > $output/rootfs/etc/s6-linux-init/env-stage2/COUNTRY_CODE
echo "$localip" > $output/rootfs/etc/s6-linux-init/env-stage2/ETH0_IP4
echo "$routerip" > $output/rootfs/etc/s6-linux-init/env-stage2/DEFAULT_ROUTER_IP4
echo ":$timezone" > $output/rootfs/etc/s6-linux-init/env/TZ