mirror of
https://github.com/RasppleII/a2cloud.git
synced 2024-12-21 06:29:57 +00:00
New system_ident to set arch-specific vars
Added a new script that sets two variables when sourced, $ras2_os and $ras2_arch. These are different than the existing variables we've been using in a2cloud/a2server and they don't (in and of themselves) presume Debian. That said, nothing's likely to work with these scripts except on Debian, so … yeah. But the script is designed not to tie you to that ultimately. Outputs the variable assignments to stdout unless you pass -q.
This commit is contained in:
parent
2b9cd2c95d
commit
e10e80e517
44
scripts/system_ident
Executable file
44
scripts/system_ident
Executable file
@ -0,0 +1,44 @@
|
||||
#! /bin/bash
|
||||
# vim: set tabstop=4 shiftwidth=4 noexpandtab filetype=sh:
|
||||
|
||||
# system_ident - identify your system for raspple2 if needed
|
||||
#
|
||||
# To the extent possible under law, T. Joseph Carter and Ivan Drucker have
|
||||
# waived all copyright and related or neighboring rights to the a2cloud
|
||||
# scripts themselves. Software used or installed by these scripts is subject
|
||||
# to other licenses. This work is published from the United States.
|
||||
|
||||
if [[ -z $ras2_os || -z $ras2_arch ]]; then
|
||||
ras2_os="unknown"
|
||||
if hash lsb_release 2>/dev/null; then
|
||||
if [[ -f /usr/bin/raspi-config ]]; then
|
||||
ras2_os="rpi-$(lsb_release -rs)"
|
||||
else
|
||||
case "$(lsb_release -is)" in
|
||||
Debian)
|
||||
ras2_os="debian-$(lsb_release -cs)"
|
||||
;;
|
||||
*)
|
||||
printf "\nUnknown OS with lsb_release\n"
|
||||
lsb_release -a
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
else
|
||||
uname_s="$(uname -s)"
|
||||
case "$uname_s" in
|
||||
Darwin)
|
||||
ras2_os="$uname_s"
|
||||
;;
|
||||
*)
|
||||
printf "\nUnknown OS with uname -s\n$uname_s\n"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
ras2_arch="$(uname -m)"
|
||||
export ras2_os ras2_arch
|
||||
fi
|
||||
|
||||
if [[ $1 != -q ]]; then
|
||||
printf "ras2_os=\"%s\"\nras2_arch=\"%s\"\n" "$ras2_os" "$ras2_arch"
|
||||
fi
|
Loading…
Reference in New Issue
Block a user