This commit is contained in:
hl committed 2024-11-18 05:40:24 +08:00
1 parent 10f9b2f4f9
commit d3b6f75599
6 files changed
+96 -77

No files matched your search

+17 -54
View File
@@ -12,7 +12,7 @@ esac
DISTRO_PVE=$((command -v pvesh &>/dev/null && echo 1) || echo 0)
SCRIPT=$(readlink -f "$0")
SCRIPTPATH=$(dirname "$SCRIPT")
AWD=$(dirname "$SCRIPT")
choose_sites(){
case $MIRROR_SOURCE in
@@ -50,21 +50,8 @@ choose_sites(){
}
configure(){
set_pkg_source(){
choose_sites
sed -i -E "s/.*set tabsize.*/set tabsize 4/g" /etc/nanorc
sed -i -E "s/.*set tabstospaces.*/set tabstospaces/g" /etc/nanorc
sed -i -E "s/.*set softwrap.*/set softwrap/g" /etc/nanorc
sed -i -E "s/.*bind \^F whereis all/bind \^F whereis all/g" /etc/nanorc
sed -i -E "s/.*bind \^B wherewas all/bind \^B wherewas all/g" /etc/nanorc
sed -i -E "/.*HashKnownHosts.*/d" /etc/ssh/ssh_config
sed -i -E "/.*HostKeyAlgorithms.*/d" /etc/ssh/ssh_config
sed -i -E "/.*PubkeyAcceptedKeyTypes.*/d" /etc/ssh/ssh_config
echo " HashKnownHosts no" >> /etc/ssh/ssh_config
echo " HostKeyAlgorithms ssh-ed25519,ssh-rsa,rsa-sha2-256" >> /etc/ssh/ssh_config
echo " PubkeyAcceptedKeyTypes ssh-ed25519,ssh-rsa,rsa-sha2-256" >> /etc/ssh/ssh_config
rm /etc/apt/sources.list || true
rm /etc/apt/sources.list.d/* || true
@@ -91,15 +78,7 @@ Suites: $OS_CODE
Components: pve-no-subscription
Signed-By: /etc/apt/trusted.gpg.d/proxmox-release-$OS_CODE.gpg
" | tee /etc/apt/sources.list.d/pve-no-subscription.sources
fi
command="nala"
apt update
apt install -y $command || command="apt"
$command install -y ca-certificates curl gnupg lsb-release zsh
if [ $DISTRO_PVE -eq 0 ]; then
else
echo -e "Types: deb
URIs: $DOCKER_URL
Suites: $OS_CODE
@@ -122,36 +101,20 @@ Architectures: $OS_ARCH
gpg --dearmor | tee /etc/apt/trusted.gpg.d/azlux-archive-keyring.gpg > /dev/null
fi
usermod -s /usr/bin/zsh $(whoami)
cp "$SCRIPTPATH/.zshrc" $HOME
cp "$SCRIPTPATH/.screenrc" $HOME
if [ $DISTRO_PVE -eq 1 ]; then
sed -i -E "s/.*prompt .*/prompt bart/g" $HOME/.zshrc
fi
cp "$SCRIPTPATH/TINK-CA.crt" /usr/local/share/ca-certificates
update-ca-certificates
if [ $DISTRO_PVE -eq 1 ]; then
sed -i -E "s/.*zoxide.*//g" $HOME/.zshrc
else
$SCRIPTPATH/install-release.sh -r zsh-users/zsh-completions -k tarball -o completions.tar.gz -d "0 src" -p /usr/local/share/zsh/site-functions
$SCRIPTPATH/install-release.sh -r ajeetdsouza/zoxide -m x86_64-unknown -p /usr/local/bin -n zoxide -f
fi
apt update
apt install -y nala ca-certificates curl gnupg lsb-release zsh
}
install_pkg(){
command="nala"
command -v $command &>/dev/null || command="apt"
$command update
test -r "$PKG_BASE"
xargs -a <(awk '! /^ *(#|$)/' "$PKG_BASE") -r $command install -y
config(){
set_pkg_source
$AWD/configure.sh
}
usage(){
echo "Usage: $0 [OPTIONS]";
echo "OPTIONS:";
echo " -f <PACKAGES> package list file (default: $PKG_BASE)";
echo " -i install only";
echo " -c config only";
echo " -m <CHOICE> apt mirror source";
echo " * official"
echo " 1 nju (default)"
@@ -160,16 +123,16 @@ usage(){
echo " 4 tsinghua"
}
PKG_BASE="$SCRIPTPATH/packages-base"
INSTALL_ONLY=0;
PKG_BASE="$AWD/packages-base"
CONFIG_ONLY=false;
MIRROR_SOURCE=1;
while getopts ":f:ipm:" OPT; do
case $OPT in
f)
PKG_BASE=$OPTARG;
;;
i)
INSTALL_ONLY=1;
c)
CONFIG_ONLY=true;
;;
m)
MIRROR_SOURCE=$OPTARG;
@@ -181,7 +144,7 @@ while getopts ":f:ipm:" OPT; do
esac;
done;
if [ $INSTALL_ONLY -eq 0 ]; then
configure;
fi;
install_pkg;
config
if ! $CONFIG_ONLY; then
$AWD/install.sh $PKG_BASE
fi