Mercurial > hgrepos > FreeBSD > ports > sysutils > local-bsdtools
comparison sbin/fjail @ 250:c4d835ccb4ae
Implement configure for symlinked skeletons.
Automatically decide if "etc" is a symlink to "skeleton/etc".
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Sun, 11 Sep 2022 13:58:08 +0200 |
| parents | 243dba574ad3 |
| children | 7f21d242f79f |
comparison
equal
deleted
inserted
replaced
| 249:a91e1c5173cc | 250:c4d835ccb4ae |
|---|---|
| 66 | 66 |
| 67 configure MOUNPOINT | 67 configure MOUNPOINT |
| 68 | 68 |
| 69 Configure some basic parts of the system at MOUNTPOINT: | 69 Configure some basic parts of the system at MOUNTPOINT: |
| 70 disable root password, syslog and other basic configuration settings | 70 disable root password, syslog and other basic configuration settings |
| 71 | |
| 72 Also handle thin jails by checking whether "etc" is a symlink to | |
| 73 "skeleton/etc". | |
| 71 | 74 |
| 72 hostid | 75 hostid |
| 73 | 76 |
| 74 Print proposals for a hostuuid and hostid | 77 Print proposals for a hostuuid and hostid |
| 75 | 78 |
| 393 | 396 |
| 394 if [ -f "${_mp}/usr/share/zoneinfo/Europe/Berlin" ]; then | 397 if [ -f "${_mp}/usr/share/zoneinfo/Europe/Berlin" ]; then |
| 395 # Timezone to CET | 398 # Timezone to CET |
| 396 if [ ! -f "${_mp}/etc/localtime" ]; then | 399 if [ ! -f "${_mp}/etc/localtime" ]; then |
| 397 echo "Setting timezone to Europe/Berlin" | 400 echo "Setting timezone to Europe/Berlin" |
| 398 ln -s ../usr/share/zoneinfo/Europe/Berlin "${_mp}/etc/localtime" | 401 # Handle thin jails automatically (but check expectations very strictly) |
| 402 if [ \( -L "${_mp}/etc" \) -a \( "$(readlink "${_mp}/etc")" = "skeleton/etc" \) ]; then | |
| 403 ln -s ../../usr/share/zoneinfo/Europe/Berlin "${_mp}/etc/localtime" | |
| 404 else | |
| 405 ln -s ../usr/share/zoneinfo/Europe/Berlin "${_mp}/etc/localtime" | |
| 406 fi | |
| 399 echo "Europe/Berlin" > "${_mp}/var/db/zoneinfo" | 407 echo "Europe/Berlin" > "${_mp}/var/db/zoneinfo" |
| 400 else | 408 else |
| 401 echo "WARNING: \"${_mp}/etc/localtime\" exists already -- not changed" | 409 echo "WARNING: \"${_mp}/etc/localtime\" exists already -- not changed" |
| 402 fi | 410 fi |
| 403 else | 411 else |
