Private
Server IP : 195.201.23.43  /  Your IP : 18.222.215.20
Web Server : Apache
System : Linux webserver2.vercom.be 5.4.0-192-generic #212-Ubuntu SMP Fri Jul 5 09:47:39 UTC 2024 x86_64
User : kdecoratie ( 1041)
PHP Version : 7.1.33-63+ubuntu20.04.1+deb.sury.org+1
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib/udev/rules.d/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /lib/udev/rules.d/99-hc-volume-automount.rules
# Check if it is a Hetzner Cloud Volume
ACTION!="add", GOTO="FINISH"
SUBSYSTEM!="block", GOTO="FINISH"
ENV{ID_VENDOR}!="HC", GOTO="FINISH"
ENV{ID_MODEL}!="Volume", GOTO="FINISH"
ENV{ID_FS_TYPE}=="", GOTO="FINISH"

# Abort unless the user explicitly requests this feature
#   The API returns a success code when the automount option is active.
#   This is just a oneshot url with an expiry of just a few mintutes.
#   On any error (404 on the URL, no curl installed, or timeout, ...) the rule will abort
IMPORT{program}="/bin/sh -c 'curl --max-time 1 --fail 169.254.169.254/_internal/v1/volumes/$env{ID_SERIAL_SHORT} > /dev/null 2>&1 && echo HC_CONFIGURE=yes'"
ENV{HC_CONFIGURE}!="yes", GOTO="FINISH"

ENV{MOUNT_PATH}="/mnt/%E{ID_VENDOR}_%E{ID_MODEL}_%E{ID_SERIAL_SHORT}"
ENV{SOURCE_PATH}="/dev/disk/by-id/%E{ID_BUS}-%E{ID_SERIAL}"
RUN{program}+="/bin/mkdir -p %E{MOUNT_PATH}"

# Create an fstab entry
RUN{program}+="/bin/sh -c 'grep -q %E{SOURCE_PATH} /etc/fstab || echo %E{SOURCE_PATH} %E{MOUNT_PATH} %E{ID_FS_TYPE} discard,nofail,defaults 0 0 >> /etc/fstab'"

# Manually trigger the fstab to systemd.mount generator
RUN{program}+="/bin/systemctl daemon-reload"

# Activates the new rule
RUN{program}+="/bin/systemctl restart local-fs.target"

LABEL="FINISH"
Private