فهرست منبع

Update update-lxcs.sh

Start the container and perform an update if it is not a template.
tteckster 2 سال پیش
والد
کامیت
1780cd99c5
1فایلهای تغییر یافته به همراه3 افزوده شده و 8 حذف شده
  1. 3 8
      misc/update-lxcs.sh

+ 3 - 8
misc/update-lxcs.sh

@@ -49,16 +49,11 @@ function update_container() {
   esac
   esac
 }
 }
 header_info
 header_info
-read -p "Skip stopped containers? [y/N]" -n 1 -r
-echo
-if [[ ! $REPLY =~ ^[Yy]$ ]]; then
-  skip=no
-else
-  skip=yes
-fi
+
 for container in $containers; do
 for container in $containers; do
   status=$(pct status $container)
   status=$(pct status $container)
-  if [ "$skip" == "no" ] && [ "$status" == "status: stopped" ]; then
+  template=$(pct config $container | grep -q "template:" && echo "true" || echo "false")
+   if [ "$template" == "false" ] && [ "$status" == "status: stopped" ]; then
       echo -e "${BL}[Info]${GN} Starting${BL} $container ${CL} \n"
       echo -e "${BL}[Info]${GN} Starting${BL} $container ${CL} \n"
       pct start $container
       pct start $container
       echo -e "${BL}[Info]${GN} Waiting For${BL} $container${CL}${GN} To Start ${CL} \n"
       echo -e "${BL}[Info]${GN} Waiting For${BL} $container${CL}${GN} To Start ${CL} \n"