Skip to content

Instantly share code, notes, and snippets.

@sancome
Created April 16, 2014 07:12
Show Gist options
  • Save sancome/10822082 to your computer and use it in GitHub Desktop.
Save sancome/10822082 to your computer and use it in GitHub Desktop.
#!/bin/bash
if [ $(id -u) != "0" ]; then
printf "Error: You must be root to run this tool!\n"
exit 1
fi
clear
printf "
##################################################
# #
# This is a Shell-Based tool for DSM on HP NxxL #
# Coded by Sancome #
# #
##################################################
"
#修正U盘识别为esata硬盘的问题
sed -i 's/.*esataportcfg.*/esataportcfg="0x10"/' /etc.defaults/synoinfo.conf
sed -i 's/.*usbportcfg.*/usbportcfg="0xfffc0"/' /etc.defaults/synoinfo.conf
sed -i 's/.*internalportcfg.*/internalportcfg="0x2f"/' /etc.defaults/synoinfo.conf
#修正每次启动后wol默认设置变成关闭,以及助手无法设置wol问题
sed -i 's/.*wol_enabled_options.*/wol_enabled_options="g"/' /etc/synoinfo.conf
sed -i 's/.*eth0_wol_options.*/eth0_wol_options="g"/' /etc/synoinfo.conf
touch /usr/syno/etc/rc.d/S99ZZZ_Shutdown.sh
chmod a+x /usr/syno/etc/rc.d/S99ZZZ_Shutdown.sh
cat >/usr/syno/etc/rc.d/S99ZZZ_Shutdown.sh<<EOF
#!/bin/sh
case \$1 in
start)
if [ -f /var/packages/shutdown_script/DSShutdown.sh ]; then
/var/packages/shutdown_script/DSShutdown.sh &
fi
;;
stop)
if [ -f /var/tmp/shut.down ]; then
rm /var/tmp/shut.down
fi
ifconfig eth0 down
;;
*)
echo "Usage: \$0 [start|stop]"
;;
esac
EOF
echo "finished! please reboot you system!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment