Dre4m Shell
Server IP : 127.0.0.2  /  Your IP : 3.129.58.166
Web Server : Apache/2.4.18 (Ubuntu)
System :
User : www-data ( )
PHP Version : 7.0.33-0ubuntu0.16.04.16
Disable Function : disk_free_space,disk_total_space,diskfreespace,dl,exec,fpaththru,getmyuid,getmypid,highlight_file,ignore_user_abord,leak,listen,link,opcache_get_configuration,opcache_get_status,passthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,php_uname,phpinfo,posix_ctermid,posix_getcwd,posix_getegid,posix_geteuid,posix_getgid,posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid,posix,_getppid,posix_getpwnam,posix_getpwuid,posix_getrlimit,posix_getsid,posix_getuid,posix_isatty,posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid,posix_setpgid,posix_setsid,posix_setuid,posix_times,posix_ttyname,posix_uname,pclose,popen,proc_open,proc_close,proc_get_status,proc_nice,proc_terminate,shell_exec,source,show_source,system,virtual
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib/recovery-mode/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /lib/recovery-mode/recovery-menu
#!/bin/bash

if [ ! -x "$(which whiptail)" ]; then
  echo "Couldn't find whiptail, starting root shell instead of recovery menu."
  sulogin
  clear
  exit
fi

systemd-notify --ready || :

# include gettext stuff
. /lib/recovery-mode/l10n.sh

# main
READONLY=true

while true; do
  unset items

  if [ "$READONLY" = "true" ]; then
    menu_text=$(eval_gettext "Recovery Menu (filesystem state: read-only)")
  else
    menu_text=$(eval_gettext "Recovery Menu (filesystem state: read/write)")
  fi

  items[c++]="resume"
  items[c++]=$(eval_gettext "   Resume normal boot")

  for i in /lib/recovery-mode/options/*; do
    if [ -x "$i" ]; then
      name="`"$i" test`"
      if [ $? -eq 0 ]; then
        items[c++]="${i##*/}"
        items[c++]="   $name"
      fi
    fi
  done

  choice="$(whiptail --nocancel --menu "$menu_text" 18 70 10 \
                             "${items[@]}" \
                             3>&1 1>&2 2>&3 3>&-)"

  if [ -z "$choice" ]; then
    continue
  fi

  if [ "$choice" = "resume" ]; then
    box_text=$(eval_gettext "You are now going to exit the recovery mode and continue the boot sequence. Please note that some graphic drivers require a full graphical boot and so will fail when resuming from recovery.
If that's the case, simply reboot from the login screen and then perform a standard boot.")
    whiptail --msgbox "$box_text" 12 70
    clear
    touch /run/friendly_recovery.resume
    systemctl daemon-reload
    systemctl --no-block isolate default.target
    exit
  fi

  /lib/recovery-mode/options/$choice test mode >/dev/null 2>&1
  retval=$?

  # Hack for the fsck case (needs to be cosidered read/write only when
  # in read-only mode and read-only only when in read/write mode)
  if [ "$choice" = "fsck" ] && [ "$READONLY" = "false" ]; then
    retval=1
  fi

  case "$retval" in
    0)
      # 0 => requires read/write
      if [ "$READONLY" = "true" ]; then
        box_text=$(eval_gettext "Continuing will remount your / filesystem in read/write mode and mount any other filesystem defined in /etc/fstab.
Do you wish to continue?")
        whiptail --yesno "$box_text" 10 70 || continue

        if [ "$choice" = "fsck" ]; then
            FSCHECK="true"
        fi

        . /etc/default/rcS
        if [ -d /run/systemd/system ]; then
            [ "$FSCKFIX" = "yes" ] && fsck_mode="-y" || fsck_mode='-a'
            [ "$FSCHECK" = "true" ] || [ -f /forcefsck ] && fsck $fsck_mode
            systemctl start --job-mode=ignore-dependencies systemd-remount-fs.service
            mount -a
        else
            [ "$FSCHECK" = "true" ] || [ -f /forcefsck ] && force_fsck="--force-fsck"
            [ "$FSCKFIX" = "yes" ] && fsck_fix="--fsck-fix"
            mountall $force_fsck $fsck_fix --no-events
        fi
        rm -f /forcefsck

        if [ "$choice" = "fsck" ]; then
          echo ""
          echo $(eval_gettext "Finished, please press ENTER")
          read TMP
        fi

        READONLY=false
      fi
    ;;

    1)
      # 1 => read-only only
      if [ "$READONLY" = "false" ]; then
        box_text=$(eval_gettext "The option you selected requires your filesystem to be in read-only mode. Unfortunately another option you selected earlier, made you exit this mode.
The easiest way of getting back in read-only mode is to reboot your system.")
        whiptail --msgbox "$box_text" 12 70
        continue
      fi
    ;;

    2)
      # 2 => works in all cases
      # nothing to do
    ;;
  esac

  export READONLY
  /lib/recovery-mode/options/$choice
done

Anon7 - 2022
AnonSec Team