From 02b2d374548aa26a591ed5ae1467c892203c760d Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 2 Dec 2013 14:33:10 +0100 Subject: Checked and changed the shebang of some more scripts. As we want to use ash in out own scripts whenever possible, only use bash where the scripts require a certain bash feature. Also add a comment right below the bash shebang that says we're not accidentally using bash here, but for a reason. --- .../rootfs-stage32/data/opt/openslx/scripts/systemd-mount_export | 1 + .../data/opt/openslx/scripts/systemd-setup_partitions | 8 ++++---- .../data/opt/openslx/scripts/systemd-setup_slx_addons | 1 + 3 files changed, 6 insertions(+), 4 deletions(-) (limited to 'remote/rootfs/rootfs-stage32/data') diff --git a/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-mount_export b/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-mount_export index 506d8f0e..4c8597a9 100755 --- a/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-mount_export +++ b/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-mount_export @@ -1,4 +1,5 @@ #!/bin/bash +# Needs full bash . /opt/openslx/config diff --git a/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-setup_partitions b/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-setup_partitions index 07bd628e..cf285fac 100755 --- a/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-setup_partitions +++ b/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-setup_partitions @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/ash # Copyright (c) 2013 - OpenSLX GmbH # # This program is free software distributed under the GPL version 2. @@ -177,15 +177,15 @@ else echo "ERROR: Could not load zram module" else TOTAL=$(grep ^MemTotal /proc/meminfo | awk '{print $2}') - USE=$[ $TOTAL / ( 2 * $CPUS ) ] + USE=$(( $TOTAL / ( 2 * $CPUS ) )) echo "Have $CPUS cores, $TOTAL kb mem, use $USE kb zram swap per core" - USE=$[ $USE * 1024 ] + USE=$(( $USE * 1024 )) DEV=0 while [ "$DEV" -lt "$CPUS" ]; do echo "$USE" > "/sys/block/zram${DEV}/disksize" mkswap "/dev/zram${DEV}" swapon "/dev/zram${DEV}" -p 1000 - DEV=$[ $DEV + 1 ] + DEV=$(( $DEV + 1 )) done fi fi diff --git a/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-setup_slx_addons b/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-setup_slx_addons index e587235e..b6f25b65 100755 --- a/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-setup_slx_addons +++ b/remote/rootfs/rootfs-stage32/data/opt/openslx/scripts/systemd-setup_slx_addons @@ -1,4 +1,5 @@ #!/bin/bash +# Needs full bash # # Script to be called by systemd # -- cgit v1.2.3-55-g7522