更新 simpleupdates/scripts/update_simpleadmin.sh

This commit is contained in:
sky 2024-12-12 23:10:05 +08:00
parent 733b516ae1
commit ed261255a6

View File

@ -5,8 +5,8 @@
GITEA_HOST="code.060070.xyz"
GITUSER="sky"
REPONAME="simple-admin"
GITTREE="beta"
GITMAINTREE="beta"
GITTREE="beta-curl"
GITMAINTREE="beta-curl"
GITDEVTREE="dev"
# Construct Gitea URLs
@ -62,8 +62,8 @@ cat <<EOF > "$TMP_SCRIPT"
GITEA_HOST="code.060070.xyz"
GITUSER="sky"
REPONAME="simple-admin"
GITTREE="beta"
GITMAINTREE="beta"
GITTREE="beta-curl"
GITMAINTREE="beta-curl"
GITDEVTREE="dev"
# Construct Gitea URLs
@ -158,8 +158,8 @@ install_lighttpd() {
systemctl stop lighttpd
echo -e "\033[0;32mInstalling/Updating Lighttpd...\033[0m"
mkdir -p "$SIMPLE_ADMIN_DIR"
wget -O "$SIMPLE_ADMIN_DIR/lighttpd.conf" $GITROOT/simpleadmin/lighttpd.conf
wget -O "/lib/systemd/system/lighttpd.service" $GITROOT/simpleadmin/systemd/lighttpd.service
curl -o "$SIMPLE_ADMIN_DIR/lighttpd.conf" "$GITROOT/simpleadmin/lighttpd.conf"
curl -o "/lib/systemd/system/lighttpd.service" "$GITROOT/simpleadmin/systemd/lighttpd.service"
ln -sf "/lib/systemd/system/lighttpd.service" "/lib/systemd/system/multi-user.target.wants/"
echo "www-data ALL = (root) NOPASSWD: /usr/sbin/iptables, /usr/sbin/ip6tables, /usrdata/simplefirewall/ttl-override, /bin/echo, /bin/cat" > /opt/etc/sudoers.d/www-data
@ -187,58 +187,58 @@ echo -e "\e[1;31m2) Installing simpleadmin from the $GITTREE branch\e[0m"
mkdir $SIMPLE_ADMIN_DIR/www/css
mkdir $SIMPLE_ADMIN_DIR/www/js
cd $SIMPLE_ADMIN_DIR/systemd
wget $GITROOT/simpleadmin/systemd/lighttpd.service
curl -o lighttpd.service "$GITROOT/simpleadmin/systemd/lighttpd.service"
sleep 1
cd $SIMPLE_ADMIN_DIR/script
wget $GITROOT/simpleadmin/script/ttl_script.sh
wget $GITROOT/simpleadmin/script/remove_watchcat.sh
wget $GITROOT/simpleadmin/script/create_watchcat.sh
curl -o ttl_script.sh "$GITROOT/simpleadmin/script/ttl_script.sh"
curl -o remove_watchcat.sh "$GITROOT/simpleadmin/script/remove_watchcat.sh"
curl -o create_watchcat.sh "$GITROOT/simpleadmin/script/create_watchcat.sh"
sleep 1
cd $SIMPLE_ADMIN_DIR/console
wget $GITROOT/simpleadmin/console/.profile
curl -o .profile "$GITROOT/simpleadmin/console/.profile"
sleep 1
cd $SIMPLE_ADMIN_DIR/console/menu
wget $GITROOT/simpleadmin/console/menu/start_menu.sh
curl -o start_menu.sh "$GITROOT/simpleadmin/console/menu/start_menu.sh"
ln -f $SIMPLE_ADMIN_DIR/console/menu/start_menu.sh /usrdata/root/bin/menu
wget $GITROOT/simpleadmin/console/menu/sfirewall_settings.sh
wget $GITROOT/simpleadmin/console/menu/LAN_settings.sh
wget $GITROOT/simpleadmin/console/menu/start_menu.sh
curl -o sfirewall_settings.sh "$GITROOT/simpleadmin/console/menu/sfirewall_settings.sh"
curl -o LAN_settings.sh "$GITROOT/simpleadmin/console/menu/LAN_settings.sh"
curl -o start_menu.sh "$GITROOT/simpleadmin/console/menu/start_menu.sh"
sleep 1
cd $SIMPLE_ADMIN_DIR/www
wget $GITROOT/simpleadmin/www/deviceinfo.html
wget $GITROOT/simpleadmin/www/favicon.ico
wget $GITROOT/simpleadmin/www/index.html
wget $GITROOT/simpleadmin/www/network.html
wget $GITROOT/simpleadmin/www/settings.html
wget $GITROOT/simpleadmin/www/sms.html
wget $GITROOT/simpleadmin/www/scanner.html
wget $GITROOT/simpleadmin/www/watchcat.html
curl -o deviceinfo.html "$GITROOT/simpleadmin/www/deviceinfo.html"
curl -o favicon.ico "$GITROOT/simpleadmin/www/favicon.ico"
curl -o index.html "$GITROOT/simpleadmin/www/index.html"
curl -o network.html "$GITROOT/simpleadmin/www/network.html"
curl -o settings.html "$GITROOT/simpleadmin/www/settings.html"
curl -o sms.html "$GITROOT/simpleadmin/www/sms.html"
curl -o scanner.html "$GITROOT/simpleadmin/www/scanner.html"
curl -o watchcat.html "$GITROOT/simpleadmin/www/watchcat.html"
sleep 1
cd $SIMPLE_ADMIN_DIR/www/js
wget $GITROOT/simpleadmin/www/js/alpinejs.min.js
wget $GITROOT/simpleadmin/www/js/bootstrap.bundle.min.js
wget $GITROOT/simpleadmin/www/js/dark-mode.js
wget $GITROOT/simpleadmin/www/js/generate-freq-box.js
wget $GITROOT/simpleadmin/www/js/parse-settings.js
wget $GITROOT/simpleadmin/www/js/populate-checkbox.js
curl -o alpinejs.min.js "$GITROOT/simpleadmin/www/js/alpinejs.min.js"
curl -o bootstrap.bundle.min.js "$GITROOT/simpleadmin/www/js/bootstrap.bundle.min.js"
curl -o dark-mode.js "$GITROOT/simpleadmin/www/js/dark-mode.js"
curl -o generate-freq-box.js "$GITROOT/simpleadmin/www/js/generate-freq-box.js"
curl -o parse-settings.js "$GITROOT/simpleadmin/www/js/parse-settings.js"
curl -o populate-checkbox.js "$GITROOT/simpleadmin/www/js/populate-checkbox.js"
sleep 1
cd $SIMPLE_ADMIN_DIR/www/css
wget $GITROOT/simpleadmin/www/css/bootstrap.min.css
wget $GITROOT/simpleadmin/www/css/styles.css
curl -o bootstrap.min.css "$GITROOT/simpleadmin/www/css/bootstrap.min.css"
curl -o styles.css "$GITROOT/simpleadmin/www/css/styles.css"
sleep 1
cd $SIMPLE_ADMIN_DIR/www/cgi-bin
wget $GITROOT/simpleadmin/www/cgi-bin/get_atcommand
wget $GITROOT/simpleadmin/www/cgi-bin/user_atcommand
wget $GITROOT/simpleadmin/www/cgi-bin/get_ping
wget $GITROOT/simpleadmin/www/cgi-bin/get_sms
wget $GITROOT/simpleadmin/www/cgi-bin/get_system_stats
wget $GITROOT/simpleadmin/www/cgi-bin/get_ttl_status
wget $GITROOT/simpleadmin/www/cgi-bin/set_ttl
wget $GITROOT/simpleadmin/www/cgi-bin/send_sms
wget $GITROOT/simpleadmin/www/cgi-bin/get_uptime
wget $GITROOT/simpleadmin/www/cgi-bin/get_watchcat_status
wget $GITROOT/simpleadmin/www/cgi-bin/set_watchcat
wget $GITROOT/simpleadmin/www/cgi-bin/watchcat_maker
curl -o get_atcommand "$GITROOT/simpleadmin/www/cgi-bin/get_atcommand"
curl -o user_atcommand "$GITROOT/simpleadmin/www/cgi-bin/user_atcommand"
curl -o get_ping "$GITROOT/simpleadmin/www/cgi-bin/get_ping"
curl -o get_sms "$GITROOT/simpleadmin/www/cgi-bin/get_sms"
curl -o get_system_stats "$GITROOT/simpleadmin/www/cgi-bin/get_system_stats"
curl -o get_ttl_status "$GITROOT/simpleadmin/www/cgi-bin/get_ttl_status"
curl -o set_ttl "$GITROOT/simpleadmin/www/cgi-bin/set_ttl"
curl -o send_sms "$GITROOT/simpleadmin/www/cgi-bin/send_sms"
curl -o get_uptime "$GITROOT/simpleadmin/www/cgi-bin/get_uptime"
curl -o get_watchcat_status "$GITROOT/simpleadmin/www/cgi-bin/get_watchcat_status"
curl -o set_watchcat "$GITROOT/simpleadmin/www/cgi-bin/set_watchcat"
curl -o watchcat_maker "$GITROOT/simpleadmin/www/cgi-bin/watchcat_maker"
sleep 1
cd /
chmod +x $SIMPLE_ADMIN_DIR/www/cgi-bin/*
@ -256,9 +256,9 @@ install_ttyd() {
echo -e "\e[1;34mStarting ttyd installation process...\e[0m"
cd $SIMPLE_ADMIN_DIR/console
curl -L -o ttyd https://code.060070.xyz/sky/simple-admin/raw/branch/main/tools/ttyd.armhf && chmod +x ttyd
wget "$GITROOT/simpleadmin/console/ttyd.bash" && chmod +x ttyd.bash
curl -o ttyd.bash "$GITROOT/simpleadmin/console/ttyd.bash" && chmod +x ttyd.bash
cd $SIMPLE_ADMIN_DIR/systemd/
wget "$GITROOT/simpleadmin/systemd/ttyd.service"
curl -o ttyd.service "$GITROOT/simpleadmin/systemd/ttyd.service"
cp -f $SIMPLE_ADMIN_DIR/systemd/ttyd.service /lib/systemd/system/
ln -sf /usrdata/simpleadmin/ttyd /bin