xxh/xonssh_xxh/host_info.sh

25 lines
973 B
Bash
Raw Normal View History

2020-02-12 00:51:13 +00:00
#!/bin/bash
xxh_home_realpath=`realpath _xxh_home_`
2020-02-16 12:59:06 +00:00
xxh_plugins_path=$xxh_home_realpath/plugins
2020-02-12 00:51:13 +00:00
2020-02-16 12:59:06 +00:00
xxh_version='dir_not_found'
if [[ -d $xxh_home_realpath ]]; then
xxh_version=`[ "$(ls -A $xxh_home_realpath)" ] && echo "version_not_found" || echo "dir_empty"`
settings_path=$xxh_home_realpath/settings.py
if [[ -f $settings_path ]]; then
xxh_version=`cat $settings_path | grep XXH_VERSION | sed -e "s/.*: '\(.*\)'/\\1/g"`
fi
2020-02-12 00:51:13 +00:00
fi
echo xxh_home_realpath=$xxh_home_realpath
echo xxh_version=$xxh_version
2020-02-16 12:59:06 +00:00
echo xxh_home_writable=`[ -w $xxh_home_realpath ] && echo "1" ||echo "0"`
echo xxh_parent_home_writable=`[ -w $(dirname $xxh_home_realpath) ] && echo "1" ||echo "0"`
echo xxh_home_freespace=`[ -d $xxh_home_realpath ] && df -k --output=avail $xxh_home_realpath | tail -n1`
echo xxh_plugins_rc=`[ -d $xxh_plugins_path ] && find $xxh_plugins_path | grep xonshrc.xsh`
2020-02-12 19:10:48 +00:00
echo bash=`command -v bash`
echo rsync=`command -v rsync`
2020-02-13 19:16:03 +00:00
echo scp=`command -v scp`