Compare commits
4 Commits
2025.0513.
...
2025.0513.
Author | SHA1 | Date | |
---|---|---|---|
89095cdc50 | |||
8d5296d9ea | |||
524d3df1b2 | |||
54dce4862f |
@ -1,3 +1,9 @@
|
|||||||
# Dropshell
|
# Dropshell
|
||||||
|
|
||||||
A system management tool for server operations, written in C++.
|
A system management tool for server operations, written in C++.
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
```
|
||||||
|
curl -fsSL https://gitea.jde.nz/public/dropshell/releases/download/latest/install.sh | bash
|
||||||
|
```
|
11
install.sh
11
install.sh
@ -3,6 +3,12 @@ set -e
|
|||||||
|
|
||||||
# download and install dropshell
|
# download and install dropshell
|
||||||
|
|
||||||
|
# Check if running as root
|
||||||
|
if [ "$EUID" -ne 0 ]; then
|
||||||
|
print_error "Please run this script as root (use sudo)"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
# 1. Determine architecture
|
# 1. Determine architecture
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
|
|
||||||
@ -33,8 +39,9 @@ fi
|
|||||||
|
|
||||||
chmod +x "$TMPDIR/dropshell"
|
chmod +x "$TMPDIR/dropshell"
|
||||||
|
|
||||||
docker run --rm -v "$TMPDIR:/tmp" -v /usr/local/bin:/target alpine sh -c "cp /tmp/dropshell /target/dropshell && ln -s /target/dropshell /target/ds"
|
cp "$TMPDIR/dropshell" /usr/local/bin/dropshell
|
||||||
rm "$TMPDIR/dropshell"
|
ln -s /usr/local/bin/dropshell /usr/local/bin/ds
|
||||||
|
rm -rf "$TMPDIR"
|
||||||
|
|
||||||
echo "dropshell installed successfully to /usr/local/bin/dropshell"
|
echo "dropshell installed successfully to /usr/local/bin/dropshell"
|
||||||
|
|
||||||
|
@ -6,20 +6,40 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
# Build for amd64
|
rm -f build_amd64/dropshell build_arm64/dropshell build/dropshell.amd64 build/dropshell.arm64
|
||||||
echo "Building for amd64..."
|
|
||||||
cmake -B build_amd64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-march=x86-64" .
|
# Build for amd64 (musl)
|
||||||
|
echo "Building for amd64 (musl)..."
|
||||||
|
cmake -B build_amd64 -DCMAKE_BUILD_TYPE=Release \
|
||||||
|
-DCMAKE_C_COMPILER=x86_64-linux-musl-gcc \
|
||||||
|
-DCMAKE_CXX_COMPILER=x86_64-linux-musl-g++ \
|
||||||
|
-DCMAKE_EXE_LINKER_FLAGS="-static" \
|
||||||
|
-DCMAKE_CXX_FLAGS="-march=x86-64" .
|
||||||
cmake --build build_amd64 --target dropshell --config Release
|
cmake --build build_amd64 --target dropshell --config Release
|
||||||
mkdir -p build
|
mkdir -p build
|
||||||
cp build_amd64/dropshell build/dropshell.amd64
|
cp build_amd64/dropshell build/dropshell.amd64
|
||||||
|
|
||||||
# Build for arm64
|
# Build for arm64 (musl)
|
||||||
echo "Building for arm64..."
|
echo "Building for arm64 (musl)..."
|
||||||
cmake -B build_arm64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-march=armv8-a" -DCMAKE_SYSTEM_PROCESSOR=aarch64 -DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc -DCMAKE_CXX_COMPILER=aarch64-linux-gnu-g++ .
|
cmake -B build_arm64 -DCMAKE_BUILD_TYPE=Release \
|
||||||
|
-DCMAKE_C_COMPILER=aarch64-linux-musl-gcc \
|
||||||
|
-DCMAKE_CXX_COMPILER=aarch64-linux-musl-g++ \
|
||||||
|
-DCMAKE_EXE_LINKER_FLAGS="-static" \
|
||||||
|
-DCMAKE_CXX_FLAGS="-march=armv8-a" \
|
||||||
|
-DCMAKE_SYSTEM_PROCESSOR=aarch64 .
|
||||||
cmake --build build_arm64 --target dropshell --config Release
|
cmake --build build_arm64 --target dropshell --config Release
|
||||||
mkdir -p build
|
mkdir -p build
|
||||||
cp build_arm64/dropshell build/dropshell.arm64
|
cp build_arm64/dropshell build/dropshell.arm64
|
||||||
|
|
||||||
|
if [ ! -f build/dropshell.amd64 ]; then
|
||||||
|
echo "build/dropshell.amd64 not found!" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -f build/dropshell.arm64 ]; then
|
||||||
|
echo "build/dropshell.arm64 not found!" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
echo "Builds complete:"
|
echo "Builds complete:"
|
||||||
ls -lh build/dropshell.*
|
ls -lh build/dropshell.*
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user