second commit

This commit is contained in:
pvincent
2024-02-22 09:56:25 +04:00
parent 35cb36cab6
commit 248193a773
21 changed files with 1865 additions and 2 deletions
Executable
+43
View File
@@ -0,0 +1,43 @@
#!/bin/bash
function install() {
echo "install on: $HOSTNAME"
echo ----------------------
[ "$(id -u)" -ne 0 ] && echo 'root privilege required' && exit 1
if [[ ! $CURDIR == '/opt/miaou-bash' ]]; then
# download and fullfill /opt/miaou-bash, then run it from folder
if [[ -L /opt/miaou-bash ]]; then
cd /opt/miaou-bash && ./install.sh "$PARAM1"
exit 0
else
rm -rf /opt/miaou-bash
TEMP=$(mktemp -d)
cd "$TEMP" || return
echo "$TEMP"
wget https://git.artcode.re/miaou/miaou-bash/archive/main.tar.gz
tar -xzf main.tar.gz
mv miaou-bash /opt/
cd /opt/miaou-bash || return
./install.sh "$PARAM1"
rm -rf "$TEMP"
exit 0
fi
else
apt-get update
apt-get install -y "${REQUIRED_PKGS[@]}"
./init.sh
fi
}
## MAIN
CURDIR=$PWD
REQUIRED_PKGS=(file git bc)
install