Skip to content

Commit 2b7470b

Browse files
committed
use snake_case for variable names
1 parent 22d454d commit 2b7470b

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/nixos-remote.sh

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ abort() {
4141
default_kexec_url=https://github.com/nix-community/nixos-images/releases/download/nixos-22.11/nixos-kexec-installer-x86_64-linux.tar.gz
4242
kexec_url="$default_kexec_url"
4343
enable_debug=""
44-
maybereboot="sleep 6 && reboot"
44+
maybe_reboot="sleep 6 && reboot"
4545
substitute_on_destination="--substitute-on-destination"
4646
nix_options=(
4747
--extra-experimental-features 'nix-command flakes'
@@ -94,7 +94,7 @@ while [[ $# -gt 0 ]]; do
9494
stop_after_disko=y
9595
;;
9696
--no-reboot)
97-
maybereboot=""
97+
maybe_reboot=""
9898
;;
9999
--option)
100100
key=$2
@@ -205,9 +205,9 @@ export $(echo "$facts" | grep -E '^(has|is)_[a-z0-9_]+=\S+' | xargs)
205205
if [[ ${has_tar-n} == "n" ]]; then
206206
abort "no tar command found, but required to unpack kexec tarball"
207207
fi
208-
maybesudo=""
208+
maybe_sudo=""
209209
if [[ ${has_sudo-n} == "y" ]]; then
210-
maybesudo="sudo"
210+
maybe_sudo="sudo"
211211
fi
212212
if [[ ${is_os-n} != "Linux" ]]; then
213213
abort "This script requires Linux as the operating system, but got $is_os"
@@ -224,22 +224,22 @@ fi
224224
if [[ ${is_kexec-n} == "n" ]] && [[ ${is_installer-n} == "n" ]]; then
225225
ssh_ <<SSH
226226
set -efu ${enable_debug}
227-
$maybesudo rm -rf /root/kexec
228-
$maybesudo mkdir -p /root/kexec
227+
$maybe_sudo rm -rf /root/kexec
228+
$maybe_sudo mkdir -p /root/kexec
229229
SSH
230230

231231
if [[ -f $kexec_url ]]; then
232-
ssh_ "${maybesudo} tar -C /root/kexec -xvzf-" <"$kexec_url"
232+
ssh_ "${maybe_sudo} tar -C /root/kexec -xvzf-" <"$kexec_url"
233233
elif [[ ${has_curl-n} == "y" ]]; then
234-
ssh_ "curl --fail -Ss -L '${kexec_url}' | ${maybesudo} tar -C /root/kexec -xvzf-"
234+
ssh_ "curl --fail -Ss -L '${kexec_url}' | ${maybe_sudo} tar -C /root/kexec -xvzf-"
235235
elif [[ ${has_wget-n} == "y" ]]; then
236-
ssh_ "wget '${kexec_url}' -O- | ${maybesudo} tar -C /root/kexec -xvzf-"
236+
ssh_ "wget '${kexec_url}' -O- | ${maybe_sudo} tar -C /root/kexec -xvzf-"
237237
else
238-
curl --fail -Ss -L "${kexec_url}" | ssh_ "${maybesudo} tar -C /root/kexec -xvzf-"
238+
curl --fail -Ss -L "${kexec_url}" | ssh_ "${maybe_sudo} tar -C /root/kexec -xvzf-"
239239
fi
240240

241241
ssh_ <<SSH
242-
TMPDIR=/root/kexec setsid ${maybesudo} /root/kexec/kexec/run
242+
TMPDIR=/root/kexec setsid ${maybe_sudo} /root/kexec/kexec/run
243243
SSH
244244

245245
# wait for machine to become unreachable
@@ -278,5 +278,5 @@ mkdir -m777 -p /mnt/tmp
278278
nixos-install --no-root-passwd --no-channel-copy --system "$nixos_system"
279279
# We will reboot in background so we can cleanly finish the script before the hosts go down.
280280
# This makes integration into scripts easier
281-
nohup bash -c '${maybereboot}' >/dev/null &
281+
nohup bash -c '${maybe_reboot}' >/dev/null &
282282
SSH

0 commit comments

Comments
 (0)